Class OpenNMSLoginModule
- java.lang.Object
-
- org.opennms.web.springframework.security.OpenNMSLoginModule
-
- All Implemented Interfaces:
javax.security.auth.spi.LoginModule
,LoginHandler
,OpenNMSLoginHandler
public class OpenNMSLoginModule extends java.lang.Object implements javax.security.auth.spi.LoginModule, LoginHandler, OpenNMSLoginHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.security.auth.callback.CallbackHandler
m_callbackHandler
protected java.util.Map<java.lang.String,?>
m_options
protected java.util.Set<java.security.Principal>
m_principals
protected java.util.Map<java.lang.String,?>
m_sharedState
protected javax.security.auth.Subject
m_subject
protected java.lang.String
m_user
-
Constructor Summary
Constructors Constructor Description OpenNMSLoginModule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abort()
javax.security.auth.callback.CallbackHandler
callbackHandler()
boolean
commit()
java.util.Set<java.security.Principal>
createPrincipals(org.springframework.security.core.GrantedAuthority authority)
static SpringSecurityUserDao
getSpringSecurityUserDao()
static UserConfig
getUserConfig()
void
initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map<java.lang.String,?> sharedState, java.util.Map<java.lang.String,?> options)
boolean
login()
boolean
logout()
java.util.Set<java.security.Principal>
principals()
boolean
requiresAdminRole()
void
setPrincipals(java.util.Set<java.security.Principal> principals)
static void
setSpringSecurityUserDao(SpringSecurityUserDao userDao)
void
setUser(java.lang.String user)
static void
setUserConfig(UserConfig userConfig)
SpringSecurityUserDao
springSecurityUserDao()
java.lang.String
user()
UserConfig
userConfig()
-
-
-
Field Detail
-
m_subject
protected javax.security.auth.Subject m_subject
-
m_callbackHandler
protected javax.security.auth.callback.CallbackHandler m_callbackHandler
-
m_sharedState
protected java.util.Map<java.lang.String,?> m_sharedState
-
m_options
protected java.util.Map<java.lang.String,?> m_options
-
m_user
protected java.lang.String m_user
-
m_principals
protected java.util.Set<java.security.Principal> m_principals
-
-
Method Detail
-
initialize
public void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map<java.lang.String,?> sharedState, java.util.Map<java.lang.String,?> options)
- Specified by:
initialize
in interfacejavax.security.auth.spi.LoginModule
-
login
public boolean login() throws javax.security.auth.login.LoginException
- Specified by:
login
in interfacejavax.security.auth.spi.LoginModule
- Throws:
javax.security.auth.login.LoginException
-
abort
public boolean abort() throws javax.security.auth.login.LoginException
- Specified by:
abort
in interfacejavax.security.auth.spi.LoginModule
- Throws:
javax.security.auth.login.LoginException
-
logout
public boolean logout() throws javax.security.auth.login.LoginException
- Specified by:
logout
in interfacejavax.security.auth.spi.LoginModule
- Throws:
javax.security.auth.login.LoginException
-
getUserConfig
public static UserConfig getUserConfig()
-
setUserConfig
public static void setUserConfig(UserConfig userConfig)
-
getSpringSecurityUserDao
public static SpringSecurityUserDao getSpringSecurityUserDao()
-
setSpringSecurityUserDao
public static void setSpringSecurityUserDao(SpringSecurityUserDao userDao)
-
commit
public boolean commit() throws javax.security.auth.login.LoginException
- Specified by:
commit
in interfacejavax.security.auth.spi.LoginModule
- Throws:
javax.security.auth.login.LoginException
-
callbackHandler
public javax.security.auth.callback.CallbackHandler callbackHandler()
- Specified by:
callbackHandler
in interfaceLoginHandler
-
userConfig
public UserConfig userConfig()
- Specified by:
userConfig
in interfaceLoginHandler
-
springSecurityUserDao
public SpringSecurityUserDao springSecurityUserDao()
- Specified by:
springSecurityUserDao
in interfaceLoginHandler
-
user
public java.lang.String user()
- Specified by:
user
in interfaceLoginHandler
-
setUser
public void setUser(java.lang.String user)
- Specified by:
setUser
in interfaceLoginHandler
-
createPrincipals
public java.util.Set<java.security.Principal> createPrincipals(org.springframework.security.core.GrantedAuthority authority)
- Specified by:
createPrincipals
in interfaceLoginHandler
-
principals
public java.util.Set<java.security.Principal> principals()
- Specified by:
principals
in interfaceLoginHandler
-
setPrincipals
public void setPrincipals(java.util.Set<java.security.Principal> principals)
- Specified by:
setPrincipals
in interfaceLoginHandler
-
requiresAdminRole
public boolean requiresAdminRole()
- Specified by:
requiresAdminRole
in interfaceOpenNMSLoginHandler
-
-