Class HtdigestCredentials
java.lang.Object
io.vertx.ext.auth.authentication.UsernamePasswordCredentials
io.vertx.ext.auth.htdigest.HtdigestCredentials
- All Implemented Interfaces:
Credentials
Credentials specific to the
HtdigestAuth authentication provider- Author:
- Stephane Bastian
-
Constructor Summary
ConstructorsConstructorDescriptionHtdigestCredentials(JsonObject jsonObject) HtdigestCredentials(String username, String password) -
Method Summary
Modifier and TypeMethodDescriptionapplyHttpChallenge(String challenge, HttpMethod method, String uri, Integer nc, String cnonce) Applies the HTTP Authorization challenge to this Credential instance.<V> voidcheckValid(V arg) Implementors should override this method to perform validation.getNc()getNonce()getQop()getRealm()getUri()setAlgorithm(String algorithm) setPassword(String password) setResponse(String response) setUsername(String username) Encodes this credential as an HTTP Authorization https://tools.ietf.org/html/rfc7235.toJson()Simple interop to downcast back to JSON for backwards compatibility.toString()Methods inherited from class UsernamePasswordCredentials
getPassword, getUsernameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Credentials
applyHttpChallenge, applyHttpChallenge
-
Constructor Details
-
HtdigestCredentials
public HtdigestCredentials() -
HtdigestCredentials
-
HtdigestCredentials
-
-
Method Details
-
getAlgorithm
-
getCnonce
-
getMethod
-
getNc
-
getNonce
-
getOpaque
-
getQop
-
getRealm
-
getResponse
-
getUri
-
setAlgorithm
-
setCnonce
-
setMethod
-
setNc
-
setNonce
-
setOpaque
-
setQop
-
setRealm
-
setResponse
-
setUri
-
setUsername
- Overrides:
setUsernamein classUsernamePasswordCredentials
-
setPassword
- Overrides:
setPasswordin classUsernamePasswordCredentials
-
checkValid
Description copied from interface:CredentialsImplementors should override this method to perform validation. An argument is allowed to allow custom validation, for example, when given a configuration property, a specific property may be allowed to be null.- Specified by:
checkValidin interfaceCredentials- Overrides:
checkValidin classUsernamePasswordCredentials- Type Parameters:
V- the generic type of the argument- Parameters:
arg- optional argument or null.- Throws:
CredentialValidationException- when the validation fails
-
toJson
Description copied from interface:CredentialsSimple interop to downcast back to JSON for backwards compatibility.- Specified by:
toJsonin interfaceCredentials- Overrides:
toJsonin classUsernamePasswordCredentials- Returns:
- JSON representation of this credential.
-
toString
- Overrides:
toStringin classUsernamePasswordCredentials
-
applyHttpChallenge
public HtdigestCredentials applyHttpChallenge(String challenge, HttpMethod method, String uri, Integer nc, String cnonce) throws CredentialValidationException Description copied from interface:CredentialsApplies the HTTP Authorization challenge to this Credential instance. The internal state can change to reflect the extra properties the challenge conveys.See https://tools.ietf.org/html/rfc7235 for more information.
- Specified by:
applyHttpChallengein interfaceCredentials- Overrides:
applyHttpChallengein classUsernamePasswordCredentials- Parameters:
challenge- the challenge is theWWW-Authenticateheader 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).- Returns:
- fluent self.
- Throws:
CredentialValidationException- if the challenge cannot be applicable.
-
toHttpAuthorization
Description copied from interface:CredentialsEncodes this credential as an HTTP Authorization https://tools.ietf.org/html/rfc7235.Calls to this method, expect that
Credentials.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.- Specified by:
toHttpAuthorizationin interfaceCredentials- Overrides:
toHttpAuthorizationin classUsernamePasswordCredentials- Returns:
- HTTP header including scheme.
-