Class AuthenticationStrategies
- java.lang.Object
-
- org.forgerock.opendj.rest2ldap.authz.AuthenticationStrategies
-
public final class AuthenticationStrategies extends Object
Factory methods ofAuthenticationStrategyallowing to perform authentication against LDAP server through different method.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AuthenticationStrategynewSaslPlainStrategy(ConnectionFactory connectionFactory, Schema schema, String authcIdTemplate)Creates anAuthenticationStrategyperforming authentication against an LDAP server using a plain SASL bind request.static AuthenticationStrategynewSearchThenBindStrategy(ConnectionFactory searchConnectionFactory, ConnectionFactory bindConnectionFactory, DN baseDN, SearchScope searchScope, String filterTemplate)Creates anAuthenticationStrategyperforming authentication against an LDAP server by first performing a lookup of the entry to bind with.static AuthenticationStrategynewSimpleBindStrategy(ConnectionFactory connectionFactory, String bindDNTemplate, Schema schema)Creates anAuthenticationStrategyperforming simple BIND authentication against an LDAP server.
-
-
-
Method Detail
-
newSimpleBindStrategy
public static AuthenticationStrategy newSimpleBindStrategy(ConnectionFactory connectionFactory, String bindDNTemplate, Schema schema)
Creates anAuthenticationStrategyperforming simple BIND authentication against an LDAP server.- Parameters:
connectionFactory-ConnectionFactoryto the LDAP server used to perform the bind operation.bindDNTemplate- Tempalte of the DN to use for the bind operation. The first %s will be replaced by the provided authentication-id (i.e: uid=%s,dc=example,dc=com)schema-Schemaused to validate the DN format.*- Returns:
- a new simple bind
AuthenticationStrategy - Throws:
NullPointerException- If a parameter is null
-
newSearchThenBindStrategy
public static AuthenticationStrategy newSearchThenBindStrategy(ConnectionFactory searchConnectionFactory, ConnectionFactory bindConnectionFactory, DN baseDN, SearchScope searchScope, String filterTemplate)
Creates anAuthenticationStrategyperforming authentication against an LDAP server by first performing a lookup of the entry to bind with. This is to find the user DN to bind with from its metadata (i.e: email address).- Parameters:
searchConnectionFactory-ConnectionFactoryto the LDAP server used to perform the lookup of the entry.bindConnectionFactory-ConnectionFactoryto the LDAP server used to perform the bind one the user's DN has been found. Can be the same than the searchConnectionFactory.baseDN- Base DN of the search request performed to find the user's DN.searchScope-SearchScopeof the search request performed to find the user's DN.filterTemplate- Filter of the search request (i.e: (&(email=%s)(objectClass=inetOrgPerson)) where the first %s will be replaced by the user's provided authentication-id.- Returns:
- a new search then bind
AuthenticationStrategy - Throws:
NullPointerException- If a parameter is null
-
newSaslPlainStrategy
public static AuthenticationStrategy newSaslPlainStrategy(ConnectionFactory connectionFactory, Schema schema, String authcIdTemplate)
Creates anAuthenticationStrategyperforming authentication against an LDAP server using a plain SASL bind request.- Parameters:
connectionFactory-ConnectionFactoryto the LDAP server to authenticate with.authcIdTemplate- Authentication identity template containing a single %s which will be replaced by the authenticating user's name. (i.e: (u:%s)schema- Schema used to perform DN validation.- Returns:
- a new SASL plain bind
AuthenticationStrategy - Throws:
NullPointerException- If a parameter is null
-
-