Package io.micronaut.security.ldap
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 Summary
ConstructorDescriptionLdapAuthenticationProvider
(LdapConfiguration configuration, LdapSearchService ldapSearchService, ContextBuilder contextBuilder, ContextAuthenticationMapper contextAuthenticationMapper, LdapGroupProcessor ldapGroupProcessor, ExecutorService executorService) -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<AuthenticationResponse>
authenticate
(T requestContext, AuthenticationRequest<?, ?> authenticationRequest) Authenticates a user with the given request.void
close()
-
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 authenticateldapSearchService
- The search servicecontextBuilder
- The context buildercontextAuthenticationMapper
- The authentication mapperldapGroupProcessor
- The group processorexecutorService
- 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 ofAuthentication
. 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 interfaceAuthenticationProvider<T>
- Parameters:
requestContext
- The http requestauthenticationRequest
- The credentials to authenticate- Returns:
- A publisher that emits 0 or 1 responses
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-