public class LoginModuleWrapper extends Object implements LoginModule
A login module is specified using the class name - and when doing a login against that module the login context will get a class instance for the module by using Clas.forName and the current thread context class loader. This means in an OSGi application the class loader of the caller bundle will be used to resolve the login module. But the caller bundle may not have any dependency on the login module since it is not aware about which login module implementation is used underneath - so in most cases the login module class will not be found.
For this reason all the contributed login modules will be wrapped using this class. As almost any Nuxeo bundle have a dependency on runtime this class will be visible from almost any Nuxeo bundle. So, the login context will instantiate this wrapper instead of the real login module and the wrapper will use OSGi logic to instantiate the wrapped login module. (by using the bundle that contributed the login module)
IMPORTANT
This class is in org.nuxeo.runtime.api package to be visible to any bundle that uses Nuxeo runtime. This is because
this package is imported by almost any bundle using Nuxeo runtime - so you don't need to declare the import package
in the OSGi manifest. In the case you don't use runtime but you are doing logins in the context of your bundle you
must import the package org.nuxeo.runtime.api
in your manifest.
Modifier and Type | Field and Description |
---|---|
protected LoginModule |
delegate |
static String |
DELEGATE_CLASS_KEY |
Constructor and Description |
---|
LoginModuleWrapper() |
Modifier and Type | Method and Description |
---|---|
boolean |
abort() |
boolean |
commit() |
protected void |
initDelegate(Map<String,?> options) |
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options) |
boolean |
login() |
boolean |
logout() |
public static final String DELEGATE_CLASS_KEY
protected LoginModule delegate
public LoginModuleWrapper()
protected void initDelegate(Map<String,?> options)
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
public boolean commit() throws LoginException
commit
in interface LoginModule
LoginException
public boolean abort() throws LoginException
abort
in interface LoginModule
LoginException
public boolean logout() throws LoginException
logout
in interface LoginModule
LoginException
Copyright © 2015 Nuxeo SA. All rights reserved.