Class GuestLoginModule
java.lang.Object
org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule
- All Implemented Interfaces:
LoginModule
The
GuestLoginModule is intended to provide backwards compatibility
with the login handling present in the JCR reference implementation located
in jackrabbit-core. While the specification claims that Repository.login(javax.jcr.Credentials, java.lang.String)
with null Credentials implies that the authentication process is
handled externally, the default implementation jackrabbit-core treated it
as 'anonymous' login such as covered by using GuestCredentials.
This LoginModule implementation performs the following tasks upon
login().
- Try to retrieve JCR credentials from the
CallbackHandlerusing theCredentialsCallback - In case no credentials could be obtained it pushes a new instance of
GuestCredentialsto the shared stated. Subsequent login modules in the authentication process may retrieve theGuestCredentialsinstead of failing to obtain any credentials.
GuestLoginModule to the shared state
in phase 1 it will add those credentials and the EveryonePrincipal
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 calling Repository.login() would be equivalent
to repository.login(new GuestCredentials().-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
GuestLoginModule
public GuestLoginModule()
-
-
Method Details
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) - Specified by:
initializein interfaceLoginModule
-
login
public boolean login()- Specified by:
loginin interfaceLoginModule
-
commit
public boolean commit()- Specified by:
commitin interfaceLoginModule
-
abort
public boolean abort()- Specified by:
abortin interfaceLoginModule
-
logout
public boolean logout()- Specified by:
logoutin interfaceLoginModule
-