public static class HttpApplication.HttpApplicationAuthenticator
extends com.sun.net.httpserver.BasicAuthenticator
HTTP server
that provides a basic HTTP authentication based on the stored user/password
values.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_REALM
Default realm for the constructor
|
Constructor and Description |
---|
HttpApplication.HttpApplicationAuthenticator()
Creates a HttpApplicationAuthenticator for the
default realm . |
HttpApplication.HttpApplicationAuthenticator(java.lang.String realm)
Creates a HttpApplicationAuthenticator for the given HTTP realm.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasCredentials()
Returns whether this authenticator has at least one user set.
|
boolean |
checkCredentials(java.lang.String username,
java.lang.String password)
Called for each incoming request to verify the given name and password
in the context of this Authenticator's realm.
|
java.lang.String |
toString() |
void |
updateCredentials(java.lang.String username,
java.lang.String password)
Updates the stored credentials of this authenticator.
|
public static final java.lang.String DEFAULT_REALM
public HttpApplication.HttpApplicationAuthenticator(java.lang.String realm)
realm
- the HTTP Basic authentication realmpublic HttpApplication.HttpApplicationAuthenticator()
default realm
.public void updateCredentials(java.lang.String username, java.lang.String password)
username
- the user name to add to the listpassword
- the password for the username to add to the listpublic boolean hasCredentials()
public boolean checkCredentials(java.lang.String username, java.lang.String password)
checkCredentials
in class com.sun.net.httpserver.BasicAuthenticator
username
- the username from the requestpassword
- the password from the requestpublic java.lang.String toString()
toString
in class java.lang.Object