Class LdapIdentityProvider

  • All Implemented Interfaces:
    org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider, org.apache.jackrabbit.oak.spi.security.authentication.external.PrincipalNameResolver

    @Service
    public class LdapIdentityProvider
    extends java.lang.Object
    implements org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider, org.apache.jackrabbit.oak.spi.security.authentication.external.PrincipalNameResolver
    LdapIdentityProvider implements an external identity provider that reads users and groups from an ldap source. Please refer to LdapProviderConfig for configuration options.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser authenticate​(@NotNull javax.jcr.Credentials credentials)  
      void close()
      Closes this provider and releases the internal pool.
      @NotNull java.lang.String fromExternalIdentityRef​(@NotNull org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef externalIdentityRef)  
      org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalGroup getGroup​(@NotNull java.lang.String name)  
      org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentity getIdentity​(@NotNull org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef ref)  
      @NotNull java.lang.String getName()  
      org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser getUser​(@NotNull java.lang.String userId)  
      @NotNull java.util.Iterator<org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalGroup> listGroups()  
      @NotNull java.util.Iterator<org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser> listUsers()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LdapIdentityProvider

        public LdapIdentityProvider()
        Default constructor for OSGi
      • LdapIdentityProvider

        public LdapIdentityProvider​(@NotNull
                                    @NotNull LdapProviderConfig config)
        Constructor for non-OSGi cases.
        Parameters:
        config - the configuration
    • Method Detail

      • close

        public void close()
        Closes this provider and releases the internal pool. This should be called by Non-OSGi users of this provider.
      • fromExternalIdentityRef

        @NotNull
        public @NotNull java.lang.String fromExternalIdentityRef​(@NotNull
                                                                 @NotNull org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef externalIdentityRef)
                                                          throws org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
        Specified by:
        fromExternalIdentityRef in interface org.apache.jackrabbit.oak.spi.security.authentication.external.PrincipalNameResolver
        Throws:
        org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Specified by:
        getName in interface org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider
      • getIdentity

        public org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentity getIdentity​(@NotNull
                                                                                                           @NotNull org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef ref)
                                                                                                    throws org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
        Specified by:
        getIdentity in interface org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider
        Throws:
        org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
      • getUser

        public org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser getUser​(@NotNull
                                                                                                   @NotNull java.lang.String userId)
                                                                                            throws org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
        Specified by:
        getUser in interface org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider
        Throws:
        org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
      • getGroup

        public org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalGroup getGroup​(@NotNull
                                                                                                     @NotNull java.lang.String name)
                                                                                              throws org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
        Specified by:
        getGroup in interface org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider
        Throws:
        org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
      • listUsers

        @NotNull
        public @NotNull java.util.Iterator<org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser> listUsers()
                                                                                                                           throws org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
        Specified by:
        listUsers in interface org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider
        Throws:
        org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
      • listGroups

        @NotNull
        public @NotNull java.util.Iterator<org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalGroup> listGroups()
                                                                                                                             throws org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
        Specified by:
        listGroups in interface org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider
        Throws:
        org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
      • authenticate

        public org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser authenticate​(@NotNull
                                                                                                        @NotNull javax.jcr.Credentials credentials)
                                                                                                 throws org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException,
                                                                                                        javax.security.auth.login.LoginException
        Specified by:
        authenticate in interface org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityProvider
        Throws:
        org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException
        javax.security.auth.login.LoginException