Class SyncopeLoginModule
- java.lang.Object
-
- org.apache.karaf.jaas.modules.AbstractKarafLoginModule
-
- org.apache.karaf.jaas.modules.syncope.SyncopeLoginModule
-
- All Implemented Interfaces:
LoginModule
public class SyncopeLoginModule extends AbstractKarafLoginModule
Karaf login module which uses Apache Syncope backend.
-
-
Field Summary
Fields Modifier and Type Field Description static StringADDRESSstatic StringADMIN_PASSWORDstatic StringADMIN_USERstatic StringUSE_ROLES_FOR_SYNCOPE2static StringVERSION-
Fields inherited from class org.apache.karaf.jaas.modules.AbstractKarafLoginModule
bundleContext, callbackHandler, commitSucceeded, debug, detailedLoginExcepion, options, principals, roleDiscriminator, rolePolicy, subject, succeeded, user
-
-
Constructor Summary
Constructors Constructor Description SyncopeLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>extractingRolesSyncope1(String response)Extract the user roles from the XML provided by Syncope 1.x.protected List<String>extractingRolesSyncope2(String response)Extract the user roles from the JSON provided by Syncope 2.x.voidinitialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)booleanlogin()-
Methods inherited from class org.apache.karaf.jaas.modules.AbstractKarafLoginModule
abort, checkPassword, clear, commit, initialize, logout
-
-
-
-
Field Detail
-
ADDRESS
public static final String ADDRESS
- See Also:
- Constant Field Values
-
VERSION
public static final String VERSION
- See Also:
- Constant Field Values
-
USE_ROLES_FOR_SYNCOPE2
public static final String USE_ROLES_FOR_SYNCOPE2
- See Also:
- Constant Field Values
-
ADMIN_USER
public static final String ADMIN_USER
- See Also:
- Constant Field Values
-
ADMIN_PASSWORD
public static final String ADMIN_PASSWORD
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
-
login
public boolean login() throws LoginException- Throws:
LoginException
-
extractingRolesSyncope1
protected List<String> extractingRolesSyncope1(String response) throws Exception
Extract the user roles from the XML provided by Syncope 1.x.- Parameters:
response- the HTTP response from Syncope.- Returns:
- the list of user roles.
- Throws:
Exception- in case of extraction failure.
-
extractingRolesSyncope2
protected List<String> extractingRolesSyncope2(String response) throws Exception
Extract the user roles from the JSON provided by Syncope 2.x.- Parameters:
response- the HTTP response from Syncope.- Returns:
- the list of user roles.
- Throws:
Exception- in case of extracting failure.
-
-