LDAP als Datenquelle für die Autorisierung
Geben Sie bei Provider URL die URL Ihres LDAP Servers an.
Geben Sie bei Optional Settings die entsprechenden Parameter zu Ihrem LDAP Server ein.
Klicken Sie auf Finish.
Optionen:
- Optional Settings
- Search Base - Definiert wo im Verzeichnis die LDAP Suche beginnt.
- CN - commonName.
- L - localityName.
- ST - stateOrProvinceName.
- O - organizationName.
- OU - organizationalUnitName.
- C - countryName.
- STREET - streetAddress.
- DC - domainComponent.
- UID - userid.
- Suffix - Root, oberstes Datenobjekt einer LDAP Datenstruktur.
- Scurity Protocol - Optionales Security Protokol (z.B. SASL, SSL).
- Security Authentication - Standard Security Protokol (none / simple / SASL)
- Search Base - Definiert wo im Verzeichnis die LDAP Suche beginnt.
- Test Connection - Eigene Zugangsdsaten. Nur notwendig um die Verbindung zu testen.
Ergebnis:
Project Management > Business Objects - Es wird die Klasse ExampleAuthorizationProvider.java generiert.
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; } }
XDEV Software Corp. - One Embarcadero Center, San Francisco, CA 94111, US
Copyright © 2015. XDEV Software Corp. All rights reserved.