LDAP as a Data Source for Authorization
Enter the URL of your LDAP server at the Provider URL.
Enter the corresponding parameters to your LDAP server under Optional Settings.
Click Finish.
Options:
Optional Settings
Search Base - Defines where in the directory the LDAP search begins.
CN - commonName.
L - localityName.
ST - stateOrProvinceName.
O - organizationName.
OU - organizationalUnitName.
C - countryName.
STREET - streetAddress.
DC - domainComponent.
UID - userid.
Suffix - Root, data object at the top of an LDAP data structure.
Scurity Protocol - Optional Security Protocol (e.g. SASL, SSL).
Security Authentication - Standard Security Protocol (none / simple / SASL)
Test Connection - Personal username and password. Only required to test the connection.
Result:
Project Management > Business Objects - The class ExampleAuthorizationProvider.java is generated.
package com.company.example.business; import com.xdev.security.authentication.CredentialsUsernamePassword; import com.xdev.security.authentication.ldap.LDAPConfiguration; import com.xdev.security.authentication.ldap.LDAPConfiguration.LDAPConfigurationBuilder; import com.xdev.security.authorization.AuthorizationConfiguration; import com.xdev.security.authorization.AuthorizationConfigurationProvider; import com.xdev.security.authorization.ldap.LDAPAuthorizationConfigurationProvider; public class ExampleAuthorizationConfigurationProvider implements AuthorizationConfigurationProvider { public static ExampleAuthorizationConfigurationProvider New(CredentialsUsernamePassword credentials) { return new ExampleAuthorizationConfigurationProvider(credentials); } private final CredentialsUsernamePassword credentials; private AuthorizationConfiguration authorizationConfiguration; private ExampleAuthorizationConfigurationProvider(CredentialsUsernamePassword credentials) { this.credentials = credentials; } @Override public AuthorizationConfiguration provideConfiguration() { if (this.authorizationConfiguration == null) { LDAPConfiguration ldapConfiguration = new LDAPConfigurationBuilder( "ldap://192.168.86.8:389/dc=xdevsoftware,dc=local").searchBase("OU=SBSUsers,OU=Users,OU=MyBusiness") .suffix("@XDEVSOFTWARE.LOCAL").securityAuthentication("simple").build(); this.authorizationConfiguration = new LDAPAuthorizationConfigurationProvider(ldapConfiguration, this.credentials).provideConfiguration(); } return this.authorizationConfiguration; } }