public interface Credentials
Modifier and Type | Method and Description |
---|---|
default Credentials |
applyHttpChallenge(String challenge)
Applies the HTTP Authorization challenge to this Credential instance.
|
default Credentials |
applyHttpChallenge(String challenge,
HttpMethod method,
String uri)
Applies the HTTP Authorization challenge to this Credential instance.
|
default Credentials |
applyHttpChallenge(String challenge,
HttpMethod method,
String uri,
Integer nc,
String cnonce)
Applies the HTTP Authorization challenge to this Credential instance.
|
default <V> void |
checkValid(V arg)
Implementors should override this method to perform validation.
|
default String |
toHttpAuthorization()
Encodes this credential as an HTTP Authorization https://tools.ietf.org/html/rfc7235.
|
JsonObject |
toJson()
Simple interop to downcast back to JSON for backwards compatibility.
|
default <V> void checkValid(V arg) throws CredentialValidationException
V
- the generic type of the argumentarg
- optional argument or null.CredentialValidationException
- when the validation failsJsonObject toJson()
default Credentials applyHttpChallenge(String challenge, HttpMethod method, String uri, Integer nc, String cnonce) throws CredentialValidationException
challenge
- the challenge is the WWW-Authenticate
header response from a 401 request.
Null challenges are allowed, and in this case, no verification will be performed, however it is
up to the implementation to permit this.method
- The http method this response is responding.uri
- The http uri this response is responding.nc
- The client internal counter (optional).cnonce
- The client internal nonce (optional).CredentialValidationException
- if the challenge cannot be applicable.default Credentials applyHttpChallenge(String challenge, HttpMethod method, String uri) throws CredentialValidationException
challenge
- the challenge is the WWW-Authenticate
header response from a 401 request.
Null challenges are allowed, and in this case, no verification will be performed, however it is
up to the implementation to permit this.method
- The http method this response is responding.uri
- The http uri this response is responding.CredentialValidationException
- if the challenge cannot be applicable.default Credentials applyHttpChallenge(String challenge) throws CredentialValidationException
challenge
- the challenge is the WWW-Authenticate
header response from a 401 request.
Null challenges are allowed, and in this case, no verification will be performed, however it is
up to the implementation to permit this.CredentialValidationException
- if the challenge cannot be applicable.default String toHttpAuthorization()
applyHttpChallenge(String, HttpMethod, String, Integer, String)
has
been prior executed. For some Authentication schemes, this isn't a requirement but doing so ensures that the
object is on the right state.UnsupportedOperationException
- when the the credential object cannot be converted to a HTTP Authorization.Copyright © 2021 Eclipse. All rights reserved.