Class ExternalLoginModule
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authentication.AbstractLoginModule
-
- org.apache.jackrabbit.oak.spi.security.authentication.external.impl.ExternalLoginModule
-
- All Implemented Interfaces:
LoginModule
public class ExternalLoginModule extends AbstractLoginModule
ExternalLoginModuleimplements aLoginModulethat uses anExternalIdentityProviderfor authentication.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARAM_IDP_NAMEName of the parameter that configures the name of the external identity provider.static StringPARAM_SYNC_HANDLER_NAMEName of the parameter that configures the name of the synchronization handler.-
Fields inherited from class org.apache.jackrabbit.oak.spi.security.authentication.AbstractLoginModule
callbackHandler, options, SHARED_KEY_ATTRIBUTES, SHARED_KEY_CREDENTIALS, SHARED_KEY_LOGIN_NAME, SHARED_KEY_PRE_AUTH_LOGIN, sharedState, subject
-
-
Constructor Summary
Constructors Constructor Description ExternalLoginModule()Default constructor for the OSGIi LoginModuleFactory case and the default non-OSGi JAAS case.ExternalLoginModule(ConfigurationParameters osgiConfig)Creates a new ExternalLoginModule with the given OSGi config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabort()protected voidclearState()Clear state information that has been created duringLoginModule.login().booleancommit()protected @NotNull Set<Class>getSupportedCredentials()voidinitialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> opts)booleanlogin()booleanlogout()Besteffort default implementation ofLoginModule.logout(), which removes all principals and all public credentials of typeCredentialsandAuthInfofrom the subject.voidsetIdpManager(@NotNull ExternalIdentityProviderManager idpManager)voidsetSyncManager(@NotNull SyncManager syncManager)-
Methods inherited from class org.apache.jackrabbit.oak.spi.security.authentication.AbstractLoginModule
closeSystemSession, getCredentials, getLoginModuleMonitor, getPrincipalProvider, getPrincipals, getPrincipals, getRoot, getSecurityProvider, getSharedCredentials, getSharedLoginName, getSharedPreAuthLogin, getUserManager, getWhiteboard, logout, onError, setAuthInfo
-
-
-
-
Field Detail
-
PARAM_IDP_NAME
public static final String PARAM_IDP_NAME
Name of the parameter that configures the name of the external identity provider.- See Also:
- Constant Field Values
-
PARAM_SYNC_HANDLER_NAME
public static final String PARAM_SYNC_HANDLER_NAME
Name of the parameter that configures the name of the synchronization handler.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExternalLoginModule
public ExternalLoginModule()
Default constructor for the OSGIi LoginModuleFactory case and the default non-OSGi JAAS case.
-
ExternalLoginModule
public ExternalLoginModule(ConfigurationParameters osgiConfig)
Creates a new ExternalLoginModule with the given OSGi config.- Parameters:
osgiConfig- the config
-
-
Method Detail
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> opts)
- Specified by:
initializein interfaceLoginModule- Overrides:
initializein classAbstractLoginModule
-
login
public boolean login() throws LoginException- Throws:
LoginException
-
commit
public boolean commit()
-
abort
public boolean abort()
- Specified by:
abortin interfaceLoginModule- Overrides:
abortin classAbstractLoginModule
-
logout
public boolean logout() throws LoginExceptionDescription copied from class:AbstractLoginModuleBesteffort default implementation ofLoginModule.logout(), which removes all principals and all public credentials of typeCredentialsandAuthInfofrom the subject. It will returnfalse, if either principal set or credentials set is empty. Note, that this implementation is not able to only remove those principals/credentials that have been added bythisvery login module instance. Therefore subclasses should overwrite this method to provide a fully compliant solution ofAbstractLoginModule.logout(). They may however take advantage ofAbstractLoginModule.logout(Set, Set)in order to simplify the implementation of a logout that is compatible with theLoginModule.logout()contract incorporating the additional recommendations highlighted at JAAS LoginModule Dev Guide- Specified by:
logoutin interfaceLoginModule- Overrides:
logoutin classAbstractLoginModule- Returns:
trueif neither principals nor public credentials of typeCredentialsorAuthInfostored in theSubjectare empty;falseotherwise- Throws:
LoginException- if the subject is readonly and destroyingDestroyablecredentials fails withDestroyFailedException.
-
clearState
protected void clearState()
Description copied from class:AbstractLoginModuleClear state information that has been created duringLoginModule.login().- Overrides:
clearStatein classAbstractLoginModule
-
getSupportedCredentials
@NotNull protected @NotNull Set<Class> getSupportedCredentials()
- Specified by:
getSupportedCredentialsin classAbstractLoginModule- Returns:
- the set of credentials classes as exposed by the configured
CredentialsSupportimplementation.
-
setSyncManager
public void setSyncManager(@NotNull @NotNull SyncManager syncManager)
-
setIdpManager
public void setIdpManager(@NotNull @NotNull ExternalIdentityProviderManager idpManager)
-
-