public abstract class BaseCertificateLoginModule extends Object implements LoginModule
Subclasses need to implement the authenticateUser() method and later call commitUserAuthentication().
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
_logger
System Logger.
|
protected Map<String,?> |
_options
Options configured for this LoginModule.
|
protected Map<String,?> |
_sharedState
State shared with other login modules.
|
| Constructor and Description |
|---|
BaseCertificateLoginModule() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
abort() |
protected abstract void |
authenticateUser()
Perform authentication decision.
|
boolean |
commit() |
protected void |
commitUserAuthentication(String[] groups)
This is a convenience method which can be used by subclasses
|
protected String |
getAppName()
Get the application name.
|
protected X509Certificate[] |
getCerts()
Get the certificate chain presented by the client.
|
protected Subject |
getSubject()
Return the subject being authenticated.
|
protected X500Principal |
getX500Principal()
Returns the subject (subject distinguished name) value from the
first certificate, in the client certificate chain, as an
X500Principal. |
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options) |
boolean |
login() |
boolean |
logout() |
protected static final Logger _logger
public final void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
initialize in interface LoginModulepublic final boolean login()
throws LoginException
login in interface LoginModuleLoginExceptionpublic final boolean commit()
throws LoginException
commit in interface LoginModuleLoginExceptionpublic final boolean abort()
throws LoginException
abort in interface LoginModuleLoginExceptionpublic final boolean logout()
throws LoginException
logout in interface LoginModuleLoginExceptionprotected final void commitUserAuthentication(String[] groups)
This is a convenience method which can be used by subclasses
Note that this method is called after the authentication has succeeded. If authentication failed do not call this method. This method sets the authentication status to success if the groups parameter is non-null.
groups - String array of group memberships for user (could be
empty).protected abstract void authenticateUser()
throws LoginException
Must be overridden to add custom functionality.
LoginException - on authentication failure.protected final String getAppName()
This may be useful when a single LoginModule has to handle multiple applications that use certificates.
protected X509Certificate[] getCerts()
protected X500Principal getX500Principal()
X500Principal. If the subject value is empty, then
the getName() method of the returned
X500Principal object returns an empty string ("").X500Principal representing the subject
distinguished name from thr first certificate, in the
client certificate chain;protected Subject getSubject()
Copyright © 2017. All rights reserved.