public class JBossTimeBasedOTPLoginModule extends Object implements LoginModule
Login Module that can be configured to validate a Time based OTP.
Usage:
This login module needs to be configured along with one of the other JBoss login modules such
as org.jboss.security.auth.spi.DatabaseServerLoginModule
or
org.jboss.security.auth.spi.LdapLoginModule
<application-policy name="otp">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag="required">
<module-option name="usersProperties">props/jmx-console-users.properties</module-option>
<module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
</login-module>
<login-module code="org.jboss.security.auth.spi.otp.JBossTimeBasedOTPLoginModule" />
</authentication>
</application-policy>
Configurable Options:
This login module requires the presence of "otp-users.properties" on the class path with the format: username=key
An example of otp-users.properties is:
admin=35cae61d6d51a7b3af
Constructor and Description |
---|
JBossTimeBasedOTPLoginModule() |
Modifier and Type | Method and Description |
---|---|
boolean |
abort() |
boolean |
commit() |
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options) |
boolean |
login() |
boolean |
logout() |
public static final String TOTP
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
initialize
in interface LoginModule
public boolean login() throws LoginException
login
in interface LoginModule
LoginException
LoginModule#login()}
public boolean commit() throws LoginException
commit
in interface LoginModule
LoginException
LoginModule#commit()}
public boolean abort() throws LoginException
abort
in interface LoginModule
LoginException
LoginModule#abort()}
public boolean logout() throws LoginException
logout
in interface LoginModule
LoginException
LoginModule#logout()}
Copyright © 2021 JBoss by Red Hat. All rights reserved.