Module one.jpro.platform.auth.core
Interface Credentials
- All Known Implementing Classes:
OAuth2Credentials,TokenCredentials,UsernamePasswordCredentials
public interface Credentials
Abstract representation of a Credentials object.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringEncodes this credential as an HTTP Authorization https://tools.ietf.org/html/rfc7235.org.json.JSONObjecttoJSON()Convert the credential information to JSON format.default <V> voidvalidate(V arg) Implementors should override this method to perform validation.
-
Method Details
-
toJSON
org.json.JSONObject toJSON()Convert the credential information to JSON format.- Returns:
- a JSON object.
-
validate
Implementors should override this method to perform validation. An argument is allowed to allow custom validation.- Type Parameters:
V- the generic type of the argument- Parameters:
arg- optional argument or null.- Throws:
CredentialValidationException- when the validation fails
-
toHttpAuthorization
Encodes this credential as an HTTP Authorization https://tools.ietf.org/html/rfc7235.- Returns:
- HTTP header including scheme.
- Throws:
UnsupportedOperationException- when the credential object cannot be converted to an HTTP Authorization.
-