Class PlaintextAuthenticator
java.lang.Object
com.sun.net.httpserver.Authenticator
com.sun.net.httpserver.BasicAuthenticator
io.prometheus.jmx.common.http.authenticator.PlaintextAuthenticator
Class to implement a username / plaintext 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
ConstructorsConstructorDescriptionPlaintextAuthenticator
(String realm, String username, String password) Constructor -
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
-
PlaintextAuthenticator
Constructor- Parameters:
realm
- realmusername
- usernamepassword
- password
-
-
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.
-