Class PBKDF2Authenticator
java.lang.Object
com.sun.net.httpserver.Authenticator
com.sun.net.httpserver.BasicAuthenticator
io.prometheus.jmx.common.http.authenticator.PBKDF2Authenticator
Class to implement a username / salted message digest password BasicAuthenticator
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.net.httpserver.Authenticator
com.sun.net.httpserver.Authenticator.Failure, com.sun.net.httpserver.Authenticator.Result, com.sun.net.httpserver.Authenticator.Retry, com.sun.net.httpserver.Authenticator.Success
-
Field Summary
Fields inherited from class com.sun.net.httpserver.BasicAuthenticator
realm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkCredentials
(String username, String password) called for each incoming request to verify the given name and password in the context of this Authenticator's realm.Methods inherited from class com.sun.net.httpserver.BasicAuthenticator
authenticate, getRealm
-
Constructor Details
-
PBKDF2Authenticator
public PBKDF2Authenticator(String realm, String username, String passwordHash, String algorithm, String salt, int iterations, int keyLength) throws GeneralSecurityException Constructor- Parameters:
realm
- realmusername
- usernamepasswordHash
- passwordHashalgorithm
- algorithmsalt
- saltiterations
- iterationskeyLength
- keyLength- Throws:
NoSuchAlgorithmException
- NoSuchAlgorithmExceptionGeneralSecurityException
-
-
Method Details
-
checkCredentials
called for each incoming request to verify the given name and password in the context of this Authenticator's realm. Any caching of credentials must be done by the implementation of this method- Specified by:
checkCredentials
in classcom.sun.net.httpserver.BasicAuthenticator
- Parameters:
username
- the username from the requestpassword
- the password from the request- Returns:
true
if the credentials are valid,false
otherwise.
-