@Exported public abstract class BasicAuthenticator extends Authenticator
checkCredentials(String,String)which is called to verify each incoming request.
|Constructor and Description|
Creates a BasicAuthenticator for the given HTTP realm
|Modifier and Type||Method and Description|
called to authenticate each incoming request.
called for each incoming request to verify the given name and password in the context of this Authenticator's realm.
returns the realm this BasicAuthenticator was created with
protected String realm
public String getRealm()
public Authenticator.Result authenticate(HttpExchange t)
Failure means the authentication has completed, but has failed due to invalid credentials.
Sucess means that the authentication has succeeded, and a Principal object representing the user can be retrieved by calling Sucess.getPrincipal() .
Retry means that another HTTP exchange is required. Any response headers needing to be sent back to the client are set in the given HttpExchange. The response code to be returned must be provided in the Retry object. Retry may occur multiple times.
username- the username from the request
password- the password from the request
trueif the credentials are valid,
Copyright © 2005, 2017, Oracle and/or its affiliates. All rights reserved.