public class AuthorizationBasedAuthProviderMapper extends Object implements AuthProviderMapper
AuthProviderMapper
that can be used to draw administrative users from another source than the regular, non-
administrative users.
This implementation uses AdminManager
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 an AuthProvider
.
Modifier and Type | Field and 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 and Description |
---|
AuthorizationBasedAuthProviderMapper() |
Modifier and Type | Method and 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) |
public static final String PROPERTY_ADMINPROVIDER_CLASSNAME
public static final String PROPERTY_USERPROVIDER_CLASSNAME
protected final AuthProvider adminProvider
protected final AuthProvider userProvider
public AuthorizationBasedAuthProviderMapper()
protected static AuthProvider instantiateProvider(String propertyName)
public AuthProvider getAuthProvider(String username)
AuthProviderMapper
getAuthProvider
in interface AuthProviderMapper
username
- A user identifier (cannot be null or empty).public Set<AuthProvider> getAuthProviders()
AuthProviderMapper
getAuthProviders
in interface AuthProviderMapper
Copyright © 2003-2008 Jive Software.