我正在尝试在Tomcat / GWT项目中配置Spnego library from Sourceforge。目前,我坚持使用configuring AuthZ来使用.getUserInfo
方法来检查用户组。
我的web.xml中包含以下内容:
<filter>
<filter-name>SpnegoHttpFilter</filter-name>
<filter-class>net.sourceforge.spnego.SpnegoHttpFilter</filter-class>
<init-param>
<param-name>spnego.allow.basic</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>spnego.allow.localhost</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>spnego.allow.unsecure.basic</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>spnego.login.client.module</param-name>
<param-value>spnego-client</param-value>
</init-param>
<init-param>
<param-name>spnego.krb5.conf</param-name>
<param-value>krb5.conf</param-value>
</init-param>
<init-param>
<param-name>spnego.login.conf</param-name>
<param-value>login.conf</param-value>
</init-param>
<init-param>
<param-name>spnego.preauth.username</param-name>
<param-value>XXXX</param-value>
</init-param>
<init-param>
<param-name>spnego.preauth.password</param-name>
<param-value>XXXX</param-value>
</init-param>
<init-param>
<param-name>spnego.login.server.module</param-name>
<param-value>spnego-server</param-value>
</init-param>
<init-param>
<param-name>spnego.prompt.ntlm</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>spnego.logger.level</param-name>
<param-value>1</param-value>
</init-param>
<!-- authoriZation (authZ) parameters -->
<init-param>
<param-name>spnego.authz.class</param-name>
<param-value>net.sourceforge.spnego.LdapAccessControl</param-value>
</init-param>
<init-param>
<param-name>spnego.authz.ldap.url</param-name>
<param-value>ldaps://XXX.XXX.XXX.XXX:XXX</param-value>
</init-param>
<init-param>
<param-name>spnego.authz.policy.file</param-name>
<param-value>spnego.policy</param-value>
</init-param>
<init-param>
<param-name>spnego.authz.unique</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>SpnegoHttpFilter</filter-name>
<url-pattern>*.html</url-pattern>
<url-pattern>*.png</url-pattern>
<url-pattern>*.jpg</url-pattern>
</filter-mapping>
这是在spnego.policy
中:
spnego.authz.resource.name.1=test-resource
spnego.authz.resource.access.1=VPN USERS
spnego.authz.resource.type.1=any
spnego.authz.ldap.filter.1=
我现在收到此错误:
java.lang.IllegalStateException: Must specify at least one spnego.authz.ldap.filter.1
at net.sourceforge.spnego.LdapAccessControl.loadPolicies(LdapAccessControl.java:823)
at net.sourceforge.spnego.LdapAccessControl.init(LdapAccessControl.java:736)
at net.sourceforge.spnego.SpnegoHttpFilter.init(SpnegoHttpFilter.java:227)
我不知道要为spnego.authz.ldap.filter.1
分配什么。指南根本没有提及。
我应该如何配置以避免此错误?