Enter the URL of your LDAP server at the Provider URL.
Enter the corresponding parameters to your LDAP server under Optional Settings.
Click Finish.
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; } } |