Class AuthorizationBasedAuthProviderMapper

  • All Implemented Interfaces:
    AuthProviderMapper

    public class AuthorizationBasedAuthProviderMapper
    extends Object
    implements AuthProviderMapper
    A 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.
    • authorizationBasedAuthMapper.adminProvider.className = org.jivesoftware.openfire.auth.DefaultAuthProvider
    • authorizationBasedAuthMapper.userProvider.className = org.jivesoftware.openfire.auth.NativeAuthProvider
    Author:
    Guus der Kinderen, guus@goodbytes.nl
    • 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.
    • Constructor Detail

      • AuthorizationBasedAuthProviderMapper

        public AuthorizationBasedAuthProviderMapper()
    • 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 interface AuthProviderMapper
        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 interface AuthProviderMapper
        Returns:
        all providers (never null).