Class GuestLoginModule
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule
-
- All Implemented Interfaces:
javax.security.auth.spi.LoginModule
public final class GuestLoginModule extends java.lang.Object implements javax.security.auth.spi.LoginModule
TheGuestLoginModule
is intended to provide backwards compatibility with the login handling present in the JCR reference implementation located in jackrabbit-core. While the specification claims thatRepository.login(javax.jcr.Credentials, java.lang.String)
withnull
Credentials implies that the authentication process is handled externally, the default implementation jackrabbit-core treated it as 'anonymous' login such as covered by usingGuestCredentials
.This
LoginModule
implementation performs the following tasks uponlogin()
.- Try to retrieve JCR credentials from the
CallbackHandler
using theCredentialsCallback
- In case no credentials could be obtained it pushes a new instance of
GuestCredentials
to the shared stated. Subsequent login modules in the authentication process may retrieve theGuestCredentials
instead of failing to obtain any credentials.
GuestLoginModule
to the shared state in phase 1 it will add those credentials and theEveryonePrincipal
to the subject in phase 2 of the login process. Subsequent login modules my choose to provide additional principals/credentials associated with a guest login.The authentication configuration using this
LoginModule
could for example look as follows:jackrabbit.oak { org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule optional; org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl required; };
In this case callingRepository.login()
would be equivalent torepository.login(new GuestCredentials()
.
-
-
Constructor Summary
Constructors Constructor Description GuestLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abort()
boolean
commit()
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()
-
-
-
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()
- Specified by:
login
in interfacejavax.security.auth.spi.LoginModule
-
commit
public boolean commit()
- Specified by:
commit
in interfacejavax.security.auth.spi.LoginModule
-
abort
public boolean abort()
- Specified by:
abort
in interfacejavax.security.auth.spi.LoginModule
-
logout
public boolean logout()
- Specified by:
logout
in interfacejavax.security.auth.spi.LoginModule
-
-