public class UsernamePasswordLoginServlet
extends javax.servlet.http.HttpServlet
Subject as
a UsernamePasswordCredential within the subject's private credentials.
By default, this Servlet assumes that the authentication method
urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport to be returned to the authentication
engine. This can be override by setting the servlet configuration parameter authnMethod.| Modifier and Type | Class and Description |
|---|---|
protected class |
UsernamePasswordLoginServlet.SimpleCallbackHandler
A callback handler that provides static name and password data to a JAAS loging process.
|
| Modifier and Type | Field and Description |
|---|---|
private String |
authenticationMethod
The authentication method returned to the authentication engine.
|
private String |
failureParam
Parameter name to indicate login failure.
|
private String |
jaasConfigName
Name of JAAS configuration used to authenticate users.
|
private String |
jaasInitParam
init-param which can be passed to the servlet to override the default JAAS config.
|
private org.slf4j.Logger |
log
Class logger.
|
private String |
loginPage
Login page name.
|
private String |
loginPageInitParam
init-param which can be passed to the servlet to override the default login page.
|
private String |
passwordAttribute
HTTP request parameter containing the user's password.
|
private static long |
serialVersionUID
Serial version UID.
|
private String |
usernameAttribute
HTTP request parameter containing the user name.
|
| Constructor and Description |
|---|
UsernamePasswordLoginServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
authenticateUser(javax.servlet.http.HttpServletRequest request,
String username,
String password)
Authenticate a username and password against JAAS.
|
void |
init(javax.servlet.ServletConfig config) |
protected void |
redirectToLoginPage(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sends the user to the login page.
|
protected void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceprivate static final long serialVersionUID
private final org.slf4j.Logger log
private String authenticationMethod
private String jaasConfigName
private final String jaasInitParam
private String loginPage
private final String loginPageInitParam
private final String failureParam
private final String usernameAttribute
private final String passwordAttribute
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletExceptionprotected void service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
service in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected void redirectToLoginPage(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
request - current requestresponse - current responseprotected void authenticateUser(javax.servlet.http.HttpServletRequest request,
String username,
String password)
throws LoginException
request - current authentication requestusername - the principal name of the user to be authenticatedpassword - the password of the user to be authenticatedLoginException - thrown if there is a problem authenticating the userCopyright © 1999-2014. All Rights Reserved.