如何配置Glassfish ldap领域

时间:2019-08-28 08:53:23

标签: ldap glassfish

我已经完成了在我们的Web应用程序上设置身份验证的任务。

ldap.example.com上有一个ldap服务器。我已经编写了一个Java程序,使用我的用户名和密码与此程序连接并检索一组属性。

我现在想通过在glasfish中使用ldap安全领域来验证我的Web应用程序。但是我不知道要填写什么。

我所拥有的信息:

Url: ldap://ldap.example.com:389
base-dn: DC=example,DC=com
userid: viktor.eriksson@example.com
password: <password>
filter: (userPrincipalName=viktor.eriksson@example.com)

attributes to fetch: cn,givenName,memberOf,mail,userPrincipalName

如果执行我的java程序,我将得到以下信息:

User name: CN=Eriksson\, Viktor - vier,OU=External Users,OU=Company,OU=Sweden,OU=NewCompany
User full name: CN=Eriksson\, Viktor - vier,OU=External Users,OU=Company,OU=Sweden,OU=NewCompany,DC=example,DC=com
mail => mail: Viktor.Eriksson@example.com
givenName => givenName: Viktor
memberOf => memberOf: CN=App-AppUsers,OU=ServiceDesk managed groups,OU=Security Groups,OU=Global,OU=Administration,DC=example,DC=com, CN=App-AppManagement,OU=ServiceDesk managed groups,OU=Security Groups,OU=Global,OU=Administration,DC=example,DC=com, CN=CompanyVpnExtUsers,OU=VPN,OU=Apps,OU=SecurityGroups,OU=COM,OU=SE,OU=Company,DC=example,DC=com, CN=CompanyMidEyeUsers,OU=VPN,OU=Apps,OU=SecurityGroups,OU=COM,OU=SE,OU=Company,DC=example,DC=com
userPrincipalName => userPrincipalName: Viktor.Eriksson@example.com
cn => cn: Eriksson, Viktor - vier

所以现在我想将其设置在玻璃鱼中。并能够在身份验证后签入我的Java代码(如果用户属于某个组/角色)。我很确定我已经正确设置了web.xml和glassfish-web.xml文件。

我应该在这里填写什么?我应该在“分配组”中写什么,这是什么意思?我读过我应该添加一些其他参数,但是我不确定那些参数。

Config view glassfish

0 个答案:

没有答案