org.webbitserver.handler.authentication
Class BasicAuthenticationHandler
java.lang.Object
org.webbitserver.handler.authentication.BasicAuthenticationHandler
- All Implemented Interfaces:
- HttpHandler
public class BasicAuthenticationHandler
- extends Object
- implements HttpHandler
Adds HTTP Basic authentication to a page. Users should provide an implementation of UsernamePasswordAuthenticator
to check the supplied credentials.
See samples.authentication.SimplePasswordsExample in the src/tests directory for a really basic usage. To implement
a custom authenticator that performs background IO, see samples.authentication.AsyncPasswordsExample.
- See Also:
PasswordAuthenticator,
InMemoryPasswords
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
USERNAME
public static final String USERNAME
- See Also:
- Constant Field Values
BasicAuthenticationHandler
public BasicAuthenticationHandler(PasswordAuthenticator authenticator)
BasicAuthenticationHandler
public BasicAuthenticationHandler(PasswordAuthenticator authenticator,
String realm)
handleHttpRequest
public void handleHttpRequest(HttpRequest request,
HttpResponse response,
HttpControl control)
throws Exception
- Specified by:
handleHttpRequest in interface HttpHandler
- Throws:
Exception
Copyright © 2013. All Rights Reserved.