为 JNDIRealm 创建 userPattern
嘿伙计们, 我必须满足用户之间的第二个区别。我刚刚粘贴了 JNDIRealm dn 给出的示例
: uid=jjones,ou=people,dc=mycompany,dc=com
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionName="cn=Manager,dc=mycompany,dc=com"
connectionPassword="secret"
connectionURL="ldap://localhost:389"
userPassword="userPassword"
userPattern="uid={0},ou=people,dc=mycompany,dc=com"
roleBase="ou=groups,dc=mycompany,dc=com"
roleName="cn"
roleSearch="(uniqueMember={0})"
/>
已更改
dn: uid=jjones,ou=people,dc=mycompany,dc=com
dn: uid =jjones,ou=robots,dc=mycompany,dc=com
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionName="cn=Manager,dc=mycompany,dc=com"
connectionPassword="secret"
connectionURL="ldap://localhost:389"
userPassword="userPassword"
userPattern="uid={0},ou={0},dc=mycompany,dc=com"
roleBase="ou=groups,dc=mycompany,dc=com"
roleName="cn"
roleSearch="(uniqueMember={0})"
/>
此调整是否满足我启用第二次区分的要求? 我不知道“{0}”是否有效,或者是否必须将其更改为“{1}”。
当我定义了“userPattern”属性时,我真的不需要“userBase”属性吗?
Hey guys,
I have to meet a second distinguishion among users. I just pasted out the example given for JNDIRealm
dn: uid=jjones,ou=people,dc=mycompany,dc=com
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionName="cn=Manager,dc=mycompany,dc=com"
connectionPassword="secret"
connectionURL="ldap://localhost:389"
userPassword="userPassword"
userPattern="uid={0},ou=people,dc=mycompany,dc=com"
roleBase="ou=groups,dc=mycompany,dc=com"
roleName="cn"
roleSearch="(uniqueMember={0})"
/>
altered
dn: uid=jjones,ou=people,dc=mycompany,dc=com
dn: uid=jjones,ou=robots,dc=mycompany,dc=com
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionName="cn=Manager,dc=mycompany,dc=com"
connectionPassword="secret"
connectionURL="ldap://localhost:389"
userPassword="userPassword"
userPattern="uid={0},ou={0},dc=mycompany,dc=com"
roleBase="ou=groups,dc=mycompany,dc=com"
roleName="cn"
roleSearch="(uniqueMember={0})"
/>
Would this adjustment meet my requirement to enable a second distinguishion?
I don not know if "{0}" works or if I have to change it to "{1}".
And is it really true, that I don't need the "userBase" attribute, when I have a "userPattern" attribute defined?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
解决方案是 userPatternArray
,如下所示:
the solution is a userPatternArray
as follows:
与我从手册和上面的推论相反,我在Tomcat 6.0.18中发现需要用冒号分隔的列表设置参数userPattern,而不是userPatternArray。
Contrary to what I deduct from the manual and the above, I found in Tomcat 6.0.18 that it's the parameter userPattern, not userPatternArray that needs to be set with a colon-separated list.
试试这个:
Try this instead: