Class LdapAuthenticationProvider<T>

java.lang.Object
io.micronaut.security.ldap.LdapAuthenticationProvider<T>
Type Parameters:
T - Request Context Type
All Implemented Interfaces:
AuthenticationProvider<T>, Closeable, AutoCloseable

public class LdapAuthenticationProvider<T> extends Object implements AuthenticationProvider<T>, Closeable
Authenticates against an LDAP server using the configuration provided through LdapConfiguration. One provider will be created for each configuration.
Since:
1.0
Author:
James Kleeh
  • Constructor Details

    • LdapAuthenticationProvider

      public LdapAuthenticationProvider(LdapConfiguration configuration, LdapSearchService ldapSearchService, ContextBuilder contextBuilder, ContextAuthenticationMapper contextAuthenticationMapper, LdapGroupProcessor ldapGroupProcessor, @Named("io") ExecutorService executorService)
      Parameters:
      configuration - The configuration to use to authenticate
      ldapSearchService - The search service
      contextBuilder - The context builder
      contextAuthenticationMapper - The authentication mapper
      ldapGroupProcessor - The group processor
      executorService - Executor Service
  • Method Details

    • authenticate

      public org.reactivestreams.Publisher<AuthenticationResponse> authenticate(T requestContext, AuthenticationRequest<?,?> authenticationRequest)
      Description copied from interface: AuthenticationProvider
      Authenticates a user with the given request. If a successful authentication is returned, the object must be an instance of Authentication. Publishers MUST emit cold observables! This method will be called for all authenticators for each authentication request and it is assumed no work will be done until the publisher is subscribed to.
      Specified by:
      authenticate in interface AuthenticationProvider<T>
      Parameters:
      requestContext - The http request
      authenticationRequest - The credentials to authenticate
      Returns:
      A publisher that emits 0 or 1 responses
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable