public class DefaultLoginModule extends Object implements LoginModule
Modifier and Type | Field and Description |
---|---|
protected AuthenticationProvider |
authProvider
The authentication provider service.
|
protected CallbackHandler |
callbackHandler
A CallbackHandler for communicating with the end user (prompting for usernames and passwords, for example).
|
protected boolean |
commitSuccess
The commit status.
|
protected boolean |
debug
LoginModule debug mode is turned off by default.
|
protected Map<String,?> |
options
Options specified in the login Configuration for this particular LoginModule.
|
protected Map<String,?> |
sharedState
State shared with other configured LoginModules.
|
protected boolean |
storePrivCreds
LoginModule private credentials storing mode is turned off by default.
|
protected boolean |
storePubCreds
LoginModule public credentials storing mode is turned off by default.
|
protected Subject |
subject
The Subject to be authenticated.
|
protected boolean |
success
The authentication status.
|
protected User |
user |
protected String |
username
The user name.
|
Modifier | Constructor and Description |
---|---|
|
DefaultLoginModule()
The default login module constructor.
|
protected |
DefaultLoginModule(AuthenticationProvider authProvider)
Create a new login module that uses the given authentication provider
|
Modifier and Type | Method and Description |
---|---|
boolean |
abort() |
boolean |
commit() |
protected void |
commitSubject(Subject containerSubject,
User user)
Default setup of the logged on Subject Principals for Tomcat
|
protected javax.jcr.Credentials |
createSubjectRepositoryCredentials(String username,
char[] password)
Creates repository credentials for the authenticated user.
|
protected AuthenticationProvider |
getAuthenticationProvider() |
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options) |
boolean |
login() |
boolean |
logout() |
protected boolean debug
LoginModule debug mode is turned off by default.
protected boolean storePubCreds
LoginModule public credentials storing mode is turned off by default.
protected boolean storePrivCreds
LoginModule private credentials storing mode is turned off by default.
protected boolean success
The authentication status.
protected boolean commitSuccess
The commit status.
protected Subject subject
The Subject to be authenticated.
protected CallbackHandler callbackHandler
A CallbackHandler for communicating with the end user (prompting for usernames and passwords, for example).
protected Map<String,?> options
Options specified in the login Configuration for this particular LoginModule.
protected AuthenticationProvider authProvider
The authentication provider service.
protected String username
The user name.
protected User user
public DefaultLoginModule()
The default login module constructor.
protected DefaultLoginModule(AuthenticationProvider authProvider)
authProvider
- the authentication provider to usepublic boolean abort() throws LoginException
abort
in interface LoginModule
LoginException
LoginModule.abort()
public boolean commit() throws LoginException
commit
in interface LoginModule
LoginException
LoginModule.commit()
public boolean login() throws LoginException
login
in interface LoginModule
LoginException
LoginModule.login()
public boolean logout() throws LoginException
logout
in interface LoginModule
LoginException
LoginModule.logout()
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
initialize
in interface LoginModule
LoginModule.initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)
protected void commitSubject(Subject containerSubject, User user)
containerSubject
- user
- protected AuthenticationProvider getAuthenticationProvider() throws SecurityException
SecurityException
protected javax.jcr.Credentials createSubjectRepositoryCredentials(String username, char[] password)
This method is invoked when the 'storedPrivCreds' option is true, to store a repository credentials for the authenticated user. By default, this method creates a repository credentials with the same user/password credentials used during authentication.
A child class can override this method to behave differently.
username
- password
- Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.