Package org.jivesoftware.openfire.auth
Class AuthorizationBasedAuthProviderMapper
- java.lang.Object
-
- org.jivesoftware.openfire.auth.AuthorizationBasedAuthProviderMapper
-
- All Implemented Interfaces:
AuthProviderMapper
public class AuthorizationBasedAuthProviderMapper extends Object implements AuthProviderMapper
AAuthProviderMapper
that can be used to draw administrative users from another source than the regular, non- administrative users. This implementation usesAdminManager
to determine if a particular user is an administrative user. When a user is not recognized, it is deemed a regular, non-administrative user. To configure this provider, the both system properties from the example below must be defined. Their value must reference the classname of anAuthProvider
.authorizationBasedAuthMapper.adminProvider.className = org.jivesoftware.openfire.auth.DefaultAuthProvider
authorizationBasedAuthMapper.userProvider.className = org.jivesoftware.openfire.auth.NativeAuthProvider
- Author:
- Guus der Kinderen, guus@goodbytes.nl
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthProvider
adminProvider
Serves the administrative users.static String
PROPERTY_ADMINPROVIDER_CLASSNAME
Name of the property of which the value is expected to be the classname of the AuthProvider which will serve the administrative users.static String
PROPERTY_USERPROVIDER_CLASSNAME
Name of the property of which the value is expected to be the classname of the AuthProvider which will serve the regular, non-administrative users.protected AuthProvider
userProvider
Serves the regular, non-administrative users.
-
Constructor Summary
Constructors Constructor Description AuthorizationBasedAuthProviderMapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthProvider
getAuthProvider(String username)
Finds a suitable AuthProvider for the user.Set<AuthProvider>
getAuthProviders()
Returns all providers that are used by this instance.protected static AuthProvider
instantiateProvider(String propertyName)
-
-
-
Field Detail
-
PROPERTY_ADMINPROVIDER_CLASSNAME
public static final String PROPERTY_ADMINPROVIDER_CLASSNAME
Name of the property of which the value is expected to be the classname of the AuthProvider which will serve the administrative users.- See Also:
- Constant Field Values
-
PROPERTY_USERPROVIDER_CLASSNAME
public static final String PROPERTY_USERPROVIDER_CLASSNAME
Name of the property of which the value is expected to be the classname of the AuthProvider which will serve the regular, non-administrative users.- See Also:
- Constant Field Values
-
adminProvider
protected final AuthProvider adminProvider
Serves the administrative users.
-
userProvider
protected final AuthProvider userProvider
Serves the regular, non-administrative users.
-
-
Method Detail
-
instantiateProvider
protected static AuthProvider instantiateProvider(String propertyName)
-
getAuthProvider
public AuthProvider getAuthProvider(String username)
Description copied from interface:AuthProviderMapper
Finds a suitable AuthProvider for the user. Returns null when no AuthProvider can be found for the particular user.- Specified by:
getAuthProvider
in interfaceAuthProviderMapper
- Parameters:
username
- A user identifier (cannot be null or empty).- Returns:
- An AuthProvider for the user (possibly null).
-
getAuthProviders
public Set<AuthProvider> getAuthProviders()
Description copied from interface:AuthProviderMapper
Returns all providers that are used by this instance. The returned collection should have a consistent, predictable iteration order.- Specified by:
getAuthProviders
in interfaceAuthProviderMapper
- Returns:
- all providers (never null).
-
-