Ich habe getan, was die Dokumentation über die Einrichtung einer LDAP-Authentifizierung in CAS gesagt hat. (https://apereo.github.io/cas/4.2.x/installation/LDAP-Authentication.html)So erstellen Sie Benutzer in CAS mit "OpenLDAP"?
Der CAS-Server wird bisher ausgeführt, konnte jedoch keinen Benutzer mit LDAP-Anmeldeinformationen anmelden. Ich verwende JXplorer einen Benutzer hinzufügen und ich hinzugefügt, dies zu deployerConfigContext.xml
:
<ldaptive:bind-search-authenticator id="authenticator"
ldapUrl="${ldap.url}"
baseDn="${ldap.baseDn}"
userFilter="${ldap.authn.searchFilter}"
bindDn="${ldap.managerDn}"
bindCredential="${ldap.managerPassword}"
connectTimeout="${ldap.connectTimeout}"
useStartTLS="${ldap.useStartTLS}"
blockWaitTime="${ldap.pool.blockWaitTime}"
maxPoolSize="${ldap.pool.maxSize}"
allowMultipleDns="${ldap.allowMultipleDns:false}"
usePasswordPolicy="${ldap.usePpolicy:false}"
minPoolSize="${ldap.pool.minSize}"
validateOnCheckOut="${ldap.pool.validateOnCheckout}"
validatePeriodically="${ldap.pool.validatePeriodically}"
validatePeriod="${ldap.pool.validatePeriod}"
idleTime="${ldap.pool.idleTime}"
prunePeriod="${ldap.pool.prunePeriod}"
failFastInitialize="true"
subtreeSearch="${ldap.subtree.search:true}"
useSSL="${ldap.use.ssl:false}"
/>
Und dann fügte ich dies auf die cas.properties
Datei:
#========================================
# General properties
#========================================
ldap.url=ldap://myip:389
# Start TLS for SSL connections
ldap.useStartTLS=false
# Directory root DN
# ldap.rootDn=dc=com
# Base DN of users to be authenticated
ldap.baseDn=ou=people,dc=maxcrc,dc=com
# LDAP connection timeout in milliseconds
ldap.connectTimeout=3000
# Manager credential DN
ldap.managerDn=cn=Manager,dc=maxcrc,dc=com
# Manager credential password
ldap.managerPassword=secret
#========================================
# LDAP connection pool configuration
#========================================
ldap.pool.minSize=1
ldap.pool.maxSize=10
ldap.pool.validateOnCheckout=false
ldap.pool.validatePeriodically=true
# Amount of time in milliseconds to block on pool exhausted condition
# before giving up.
ldap.pool.blockWaitTime=3000
# Frequency of connection validation in seconds
# Only applies if validatePeriodically=true
ldap.pool.validatePeriod=300
# Attempt to prune connections every N seconds
ldap.pool.prunePeriod=300
# Maximum amount of time an idle connection is allowed to be in
# pool before it is liable to be removed/destroyed
ldap.pool.idleTime=600
#========================================
# Authentication
#========================================
ldap.authn.searchFilter=cn={user}
# Ldap domain used to resolve dn
ldap.domain=example.org
# Should LDAP Password Policy be enabled?
ldap.usePpolicy=false
# Allow multiple DNs during authentication?
ldap.allowMultipleDns=false
Jetzt konnte ich keine Informationen finden, wie Erstellen eines Benutzers in LDAP für CAS Ja, ich sah einige Attribute, die echt zu sein scheinen. Also habe ich einen organizationalPerson
im JXplorer erstellt. Ich stelle ein Passwort ein und versuche mich mit dem Benutzernamen einzuloggen(). Aber wie ich erwartet habe, hat das nicht funktioniert.
Gibt es irgendwelche Informationen darüber, was CAS eigentlich von LDAP erwartet? Es muss eine Art Richtlinie geben. Die cas.properties
Information sagt: Base DN von Benutzern authentifiziert werden, aber wie weiß CAS, welches Attribut der Benutzer hat, oder muss er es überhaupt wissen?
Also meine Frage zusammenzufassen: Wie erstelle ich einen Benutzer in LDAP, ODER wie muss der Benutzer aussehen? Was muss ich mit CAS (deployerConfigContext.xml
) machen, dass CAS meinen LDAP-Server versteht?