Package io.micronaut.security.ldap
Class LdapAuthenticationProvider<T,I,S>
java.lang.Object
io.micronaut.security.ldap.LdapAuthenticationProvider<T,I,S>
- Type Parameters:
T- Request Context TypeI- Authentication Request Identity TypeS- Authentication Request Secret Type
- All Implemented Interfaces:
io.micronaut.core.order.Ordered,AuthenticationProvider<T,,I, S> ExecutorAuthenticationProvider<T,,I, S> Closeable,AutoCloseable
public class LdapAuthenticationProvider<T,I,S>
extends Object
implements ExecutorAuthenticationProvider<T,I,S>, 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
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionLdapAuthenticationProvider(LdapConfiguration configuration, LdapSearchService ldapSearchService, ContextBuilder contextBuilder, ContextAuthenticationMapper contextAuthenticationMapper, LdapGroupProcessor ldapGroupProcessor, ExecutorService executorService) -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(T requestContext, AuthenticationRequest<I, S> authenticationRequest) Authenticates a user with the given request.voidclose()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.security.authentication.provider.AuthenticationProvider
authenticateMethods inherited from interface io.micronaut.security.authentication.provider.ExecutorAuthenticationProvider
getExecutorNameMethods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
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 AuthenticationResponse authenticate(T requestContext, AuthenticationRequest<I, S> authenticationRequest) Description copied from interface:AuthenticationProviderAuthenticates a user with the given request. If authenticated successfully returnAuthenticationResponse.success(String). If not authenticated returnAuthenticationResponse.failure(). If your implementation is blocking, annotate the overriden method withBlockingand it will be safely executed on a dedicated thread in order to not block the main reactive chain of execution.- Specified by:
authenticatein interfaceAuthenticationProvider<T,I, S> - Parameters:
requestContext- The context request (typically an HTTP Request).authenticationRequest- The credentials to authenticate- Returns:
- An
AuthenticationResponseindicating either success or failure.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-