Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

  1. Selektieren Sie bei Provider type > LDAP.
  2. Wählen Sie im folgenden Dialog Authentication Provider und klicken Sie Next >.

  3. Provider URL: die URL Ihres LDAP Servers an.

  4. Geben Sie bei Optional Settings die entsprechenden Parameter zu Ihrem LDAP Server ein.

  5. Geben Sie bei Test Connection Ihre LDAP Zugangsdaten an, falls Sie die Verbindung testen möchten.

  6. 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)
  • Test Connection - Eigene Zugangsdsaten. Nur notwendig um die Verbindung zu testen.
Ergebnis:
  • Project Management > Business Objects - Es wird die Klasse ExampleAuthenticationProvider.java generiert.

    package com.company.example.business;
    
    import javax.naming.directory.DirContext;
    
    import com.xdev.security.authentication.Authenticator;
    import com.xdev.security.authentication.AuthenticatorProvider;
    import com.xdev.security.authentication.CredentialsUsernamePassword;
    import com.xdev.security.authentication.ldap.LDAPAuthenticator;
    import com.xdev.security.authentication.ldap.LDAPConfiguration.LDAPConfigurationBuilder;
    
    public class MyAuthenticationProvider implements AuthenticatorProvider<CredentialsUsernamePassword, DirContext> {
    	private static MyAuthenticationProvider INSTANCE;
    
    	public static MyAuthenticationProvider getInstance() {
    		if (INSTANCE == null) {
    			INSTANCE = new MyAuthenticationProvider();
    		}
    
    		return INSTANCE;
    	}
    
    	private LDAPAuthenticator authenticator;
    
    	private MyAuthenticationProvider() {
    	}
    
    	@Override
    	public Authenticator<CredentialsUsernamePassword, DirContext> provideAuthenticator() {
    		if (this.authenticator == null) {
    			this.authenticator = new LDAPAuthenticator(
    					new LDAPConfigurationBuilder("ldap://192.168.90.7:389/dc=yourDomainComponent,dc=local")
    							.searchBase("OU=SBSUsers,OU=Users,OU=MyBusiness").suffix("@YOURDOMAIN.LOCAL")
    							.securityAuthentication("simple").build());
    		}
    
    		return this.authenticator;
    	}
    }
  • No labels