Package io.vertx.ext.auth.htdigest
Class HtdigestCredentials
- java.lang.Object
-
- io.vertx.ext.auth.authentication.UsernamePasswordCredentials
-
- io.vertx.ext.auth.htdigest.HtdigestCredentials
-
- All Implemented Interfaces:
Credentials
public class HtdigestCredentials extends UsernamePasswordCredentials implements Credentials
Credentials specific to theHtdigestAuth
authentication provider- Author:
- Stephane Bastian
-
-
Constructor Summary
Constructors Constructor Description HtdigestCredentials()
HtdigestCredentials(JsonObject jsonObject)
HtdigestCredentials(String username, String password)
-
Method Summary
-
Methods inherited from class io.vertx.ext.auth.authentication.UsernamePasswordCredentials
getPassword, getUsername
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.vertx.ext.auth.authentication.Credentials
applyHttpChallenge, applyHttpChallenge
-
-
-
-
Constructor Detail
-
HtdigestCredentials
public HtdigestCredentials()
-
HtdigestCredentials
public HtdigestCredentials(JsonObject jsonObject)
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
-
getCnonce
public String getCnonce()
-
getMethod
public String getMethod()
-
getNc
public String getNc()
-
getNonce
public String getNonce()
-
getOpaque
public String getOpaque()
-
getQop
public String getQop()
-
getRealm
public String getRealm()
-
getResponse
public String getResponse()
-
getUri
public String getUri()
-
setAlgorithm
public HtdigestCredentials setAlgorithm(String algorithm)
-
setCnonce
public HtdigestCredentials setCnonce(String cnonce)
-
setMethod
public HtdigestCredentials setMethod(String method)
-
setNc
public HtdigestCredentials setNc(String nc)
-
setNonce
public HtdigestCredentials setNonce(String nonce)
-
setOpaque
public HtdigestCredentials setOpaque(String opaque)
-
setQop
public HtdigestCredentials setQop(String qop)
-
setRealm
public HtdigestCredentials setRealm(String realm)
-
setResponse
public HtdigestCredentials setResponse(String response)
-
setUri
public HtdigestCredentials setUri(String uri)
-
setUsername
public HtdigestCredentials setUsername(String username)
- Overrides:
setUsername
in classUsernamePasswordCredentials
-
setPassword
public HtdigestCredentials setPassword(String password)
- Overrides:
setPassword
in classUsernamePasswordCredentials
-
checkValid
public <V> void checkValid(V arg) throws CredentialValidationException
Description copied from interface:Credentials
Implementors 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:
checkValid
in interfaceCredentials
- Overrides:
checkValid
in classUsernamePasswordCredentials
- Type Parameters:
V
- the generic type of the argument- Parameters:
arg
- optional argument or null.- Throws:
CredentialValidationException
- when the validation fails
-
toJson
public JsonObject toJson()
Description copied from interface:Credentials
Simple interop to downcast back to JSON for backwards compatibility.- Specified by:
toJson
in interfaceCredentials
- Overrides:
toJson
in classUsernamePasswordCredentials
- Returns:
- JSON representation of this credential.
-
toString
public String toString()
- Overrides:
toString
in classUsernamePasswordCredentials
-
applyHttpChallenge
public HtdigestCredentials applyHttpChallenge(String challenge, HttpMethod method, String uri, Integer nc, String cnonce) throws CredentialValidationException
Description copied from interface:Credentials
Applies 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:
applyHttpChallenge
in interfaceCredentials
- Overrides:
applyHttpChallenge
in classUsernamePasswordCredentials
- Parameters:
challenge
- the challenge is theWWW-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).- Returns:
- fluent self.
- Throws:
CredentialValidationException
- if the challenge cannot be applicable.
-
toHttpAuthorization
public String toHttpAuthorization()
Description copied from interface:Credentials
Encodes 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:
toHttpAuthorization
in interfaceCredentials
- Overrides:
toHttpAuthorization
in classUsernamePasswordCredentials
- Returns:
- HTTP header including scheme.
-
-