Class MessageDigestAuthenticator

java.lang.Object
com.sun.net.httpserver.Authenticator
com.sun.net.httpserver.BasicAuthenticator
io.prometheus.jmx.common.http.authenticator.MessageDigestAuthenticator

public class MessageDigestAuthenticator extends com.sun.net.httpserver.BasicAuthenticator
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
    Constructor
    Description
    MessageDigestAuthenticator(String realm, String username, String passwordHash, String algorithm, String salt)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • checkCredentials

      public boolean 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. Any caching of credentials must be done by the implementation of this method
      Specified by:
      checkCredentials in class com.sun.net.httpserver.BasicAuthenticator
      Parameters:
      username - the username from the request
      password - the password from the request
      Returns:
      true if the credentials are valid, false otherwise.