【问题标题】:CAS 6.0 How to authenticate user/password with LDAPCAS 6.0 如何使用 LDAP 验证用户/密码
【发布时间】:2019-09-27 15:37:09
【问题描述】:

当我尝试使用登录名/密码将 cas-overlay-6.0 连接到 ldap Oracle 目录服务器 11 进入 cas 6.0 应用程序时,出现此错误:

谁:myLogin 什么:提供的凭据:

[UsernamePasswordCredential(username=myLogin, source=null)] 操作:

AUTHENTICATION_FAILED 应用程序:CAS

我的 cas.properties:

cas.authn.ldap[0].ldapUrl=ldap://monserveur.fr
# Identifiant pour se connecter au LDAP
cas.authn.ldap[0].bindDn=cn=Directory Manager
cas.authn.ldap[0].bindCredential=myPassword

cas.authn.ldap[0].baseDn=ou=personnels,ou=XX-XXX-XXXX,ou=edu,o=gov,c=uk
cas.authn.ldap[0].searchFilter=uid={user}
cas.authn.ldap[0].subtreeSearch=true
#cas.authn.ldap[0].principalAttributeList=cn,givenName,mail,sn
cas.authn.ldap[0].principalAttributePassword=userPassword

注意:密码是 ldap 中的 SSHA 编码。

如何验证问题出在哪里? 例如,当我输入错误的 baseDn 或 searchFilter 时,我会遇到同样的错误。 如何进行简单的登录/密码测试以消除错误?

cas如何处理密码,即是ldap进行密码比较还是cas?

如果是 cas 执行密码比较如何配置 cas

提前感谢您的帮助!

【问题讨论】:

  • 看来您指的不是6.x documentation,而是5.x。请参阅password encoding 部分。您还需要将 principalAttributePassword 值设置为正确的属性类型(例如principalAttributePassword=userPassword)。
  • 感谢您的留言。我尝试了良好的文档,但我遇到了同样的问题。我已经修改了主题。
  • 您必须为 bindDnbaseDn 提供完整的 dn。您的目录中的用户条目在哪里?请提供示例用户 dn。此外,您的配置似乎缺少一些参数。
  • 感谢您的帮助!我修改了这个例子。 baseDn 是使用的匿名示例。 bindDn 正是我在 apache 目录工作室中使用的。
  • 好的,但 bindDn 不完整(它可能与 cn=Directory Manager,dc=example,dc=com 之类的基本组件有关?)在 Apache DS 左侧窗格的 DIT 中查找确切条目的 dn。

标签: ldap connection cas opends ssha


【解决方案1】:

它适用于SSHA密码,无需配置或更改。

cas-overlay-6.0 和 ldap Oracle Directory Server 11 提供的 CAS 6.0.5 示例。

cas.properties:

cas.server.name=https://yourServer:8443
cas.server.prefix=${cas.server.name}/cas

# usefull to modifiy log level. Right path for cas-overlay-6.0
logging.config=file:/etc/cas/config/log4j2.xml

# connexion au ldap sur votre serveur ldap en anonyme 
############################################################################### 
cas.authn.ldap[0].ldapUrl=ldap://myServer.fr:389/ 
cas.authn.ldap[0].type=ANONYMOUS 
cas.authn.ldap[0].useSsl=false 
cas.authn.ldap[0].useStartTls=false 

# connexion au ldap en mode authentifié 
############################################################################### 
#cas.authn.ldap[0].ldapUrl=ldap://myServer.fr:389/ 
#cas.authn.ldap[0].useSsl=false 
#cas.authn.ldap[0].useStartTls=false 
#cas.authn.ldap[0].type=AUTHENTICATED 
## Identifiant pour se connecter au LDAP 
#cas.authn.ldap[0].bindDn=cn=Directory Manager 
#cas.authn.ldap[0].bindCredential=myPassword 


# search for cas user who try to test login connection 
################################################################################ 
cas.authn.ldap[0].baseDn=ou=XXXXXX,ou=educ,o=gouv,c=fr 
cas.authn.ldap[0].subtreeSearch=true 
cas.authn.ldap[0].searchFilter=(&(objectClass=person)(uid={user}))
#cas.authn.ldap[0].searchFilter=uid={user} 
#cas.authn.ldap[0].principalAttributeList=cn,givenName,mail,sn

使用 cas-overlay-6.0 您需要复制 conf : ./build.sh 复制

在出现问题时进行测试:

cas 服务器端:

telnet yourLdapServer.fr 389

必须有效!

ldapsearch -h yourLdapServer.fr -D "cn=Directory Manager" -w yourPassword -b "ou=personnels,ou=XXXXX,ou=educ,o=gouv,c=fr"  uid=loginTest

或匿名连接

ldapsearch -h yourLdapServer.fr -x -b "ou=personnels,ou=XXXXX,ou=educ,o=gouv,c=fr"  uid=loginTest 

必须提供卡

ldap 服务器端

tcpdump -v -i eth0 -s 0 -A 'tcp dst port 389'

必须提供这样的行(当您运行 ldapsearch 或 cas 测试登录连接时):

tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
18:04:23.846472 IP (tos 0x0, ttl  64, id 19303, offset 0, flags [DF], proto 6, length: 60) yourCasServer.fr.59810 > yourLdapServer.ldap: S [tcp sum ok] ...

如果 cas 和 ldap 之间的连接失败,请更正 cas.properties 中的这一行:

cas.authn.ldap[0].ldapUrl=ldap://myServer.fr:389/ 
cas.authn.ldap[0].type=ANONYMOUS 
cas.authn.ldap[0].useSsl=false 
cas.authn.ldap[0].useStartTls=false 

当 cas 和 ldap 之间的连接正常时,请检查 cas 日志并访问 ldap 日志以获取更多信息!

【讨论】:

    猜你喜欢
    • 2013-07-05
    • 2012-08-22
    • 1970-01-01
    • 2015-02-05
    • 1970-01-01
    • 2017-07-31
    • 1970-01-01
    • 1970-01-01
    • 2017-06-05
    相关资源
    最近更新 更多