Web services 禁止获取403,尝试访问安全的web服务
是否有人使用Active Directory凭据而不是特定于应用程序的用户名/密码成功保护web服务 我有一个与使用Axis2 1.5.1编写并部署在Tomcat 6.0.24上、部署在Linux、FWIW上的web服务对话的应用程序 我已经将Tomcat从一个JDBCRealm(针对数据库进行身份验证)更改为一个JAASRealm,配置为使用Centrify(客户端的首选解决方案)访问AD 这适用于web应用程序,但对于web服务,我得到了403响应 我已经使用一个简单的Axis2服务(用Axis2 1.5.1编写)进行了测试,并针对Tomcat 6.0.24和7.0.63进行了部署。我还尝试了使用Axis2 1.6.2编写的web服务。我在每种情况下都得到相同的结果。顺便说一句,我正在使用浏览器进行测试。当服务工作时,我得到了xml;如果没有,我就会得到错误 我想知道是否需要更改axis2.xml中的某些内容,因为甚至Web services 禁止获取403,尝试访问安全的web服务,web-services,tomcat,active-directory,single-sign-on,axis2,Web Services,Tomcat,Active Directory,Single Sign On,Axis2,是否有人使用Active Directory凭据而不是特定于应用程序的用户名/密码成功保护web服务 我有一个与使用Axis2 1.5.1编写并部署在Tomcat 6.0.24上、部署在Linux、FWIW上的web服务对话的应用程序 我已经将Tomcat从一个JDBCRealm(针对数据库进行身份验证)更改为一个JAASRealm,配置为使用Centrify(客户端的首选解决方案)访问AD 这适用于web应用程序,但对于web服务,我得到了403响应 我已经使用一个简单的Axis2服务(用Ax
https://tomcat:8443/HelloWorld
(我的服务称为HelloWorld)生成403
一些配置详细信息
我已将server.xml中的领域更改为以下内容
<Realm className="org.apache.catalina.realm.JAASRealm"
appName="CENTRIFYDC"
roleClassName="com.centrify.dc.tomcat.RolesPrincipal"
userClassName="com.centrify.dc.tomcat.LoginPrincipal" />
<Valve className="com.centrify.dc.tomcat.ContextValve" />
在web.xml中,我添加了
<security-constraint>
<display-name>Security Web Service</display-name>
<web-resource-collection>
<web-resource-name>Secured Area</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>USER</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>SPNEGO</auth-method>
<realm-name>CENTRIFYDC</realm-name>
</login-config>
<!-- Security roles referenced by this web application -->
<security-role>
<role-name>USER</role-name>
</security-role>
安全Web服务
安全区
/*
使用者
斯普尼戈
CENTRIFYDC
使用者
我已将用户角色映射到我的一个广告组
任何对某人有用的建议、指导或设置都将非常有用,谢谢。403错误表明身份验证后存在权限问题。这是因为在SSO之后,服务器将检查组成员身份,以查看用户是否获得了适当的权限。403错误来自角色映射的配置部分。到服务器的SSO实际上工作正常 我们建议您尝试以下操作(下面的示例使用的是5.5版本的tomcat,但在以后的版本中也是如此):
- 为中心化配置tomcat
cd /usr/share/centrifydc/java
./configure.pl
Enter /opt/apache-tomcat-5.5.25 when prompted for the tomcat directory.
Enter /usr/jdk1.5.0_15 when prompted for the java directory.
Enter y when prompted if you want to configure Tomcat for SSL
Enter n when prompted if you want to configure Tomcat for SSL communication with ADFS server
Take default for everything else.
- 将webdav配置为中心化,并使用kerberos(SPNEGO)进行身份验证
<Context path="/webdav">
<Realm className="org.apache.catalina.realm.JAASRealm"
appName="CENTRIFYDC"
roleClassNames="com.centrify.dc.tomcat.RolesPrincipal"
userClassNames="com.centrify.dc.tomcat.LoginPrincipal"/>
<Valve className="com.centrify.dc.tomcat.ContextValve"/> </Context>
<RoleMapping separator=";">
<Role name="user" group="*" user="*"/>
<Role name="@ROLE2@" group="@GROUP2@"/>
<Role name="@ROLE3@" user="@USER3@"/>
</RoleMapping>
<login-config>
<auth-method>SPNEGO</auth-method>
<realm-name>Default</realm-name>
</login-config>
<!--
OPTIONAL: Add CentrifyFilter to set the authenticated user's attributes
such as group membership in HTTP headers. You must also configure the
<SetHeaders> element in centrifydc.xml to set user attributes in HTTP
headers.
This filter is not needed if you do not want the authenticated
user's attributes set in HTTP headers.
-->
<filter>
<filter-name>CentrifyFilter</filter-name>
<filter-class>com.centrify.dc.wbase.DCFilter</filter-class>
</filter>
<!--
OPTIONAL: Apply (map) CentrifyFilter to the url patterns in the
<security-constraint> section of this application to set the
authenticated user's attributes in HTTP headers.
This <filter-mapping> is not needed if you do not want the
authenticated user's attributes set in HTTP headers.
-->
<filter-mapping>
<filter-name>CentrifyFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>ProtectedResource</web-resource-name>
<url-pattern>/index.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<description>
An test role
</description>
<role-name>user</role-name>
</security-role>
斯普尼戈
违约
定心过滤器
com.centrify.dc.wbase.DCFilter
定心过滤器
/*
保护资源
/index.html
用户
测试角色
用户
<RoleMapping separator=";">
<Role name="user" group="*" user="*"/>
<Role name="@ROLE2@" group="@GROUP2@"/>
<Role name="@ROLE3@" user="@USER3@"/>
</RoleMapping>
可扩展标记语言(XML)文件(如centrifydc.XML文件)是结构化文档,其中包含一组受支持的元素,这些元素用左括号(<>)括起来。根据应用的要求,这些元件可以是必需的,也可以是可选的。以下是如何在centrifydc.xml文件中定义关键元素的示例:
<Centrifydc>
<enableAuthSchemes>Negotiate,NTLM,Basic</enableAuthSchemes>
<adclientSocket>/var/centrifydc/daemon</adclientSocket>
<RoleMapping>
<Role name=”role1” group=”arcade.com/Users/Sales”/>
</RoleMapping>
</Centrifydc>
协商,NTLM,基本
/var/centrifydc/daemon
尽管模板centrifydc.xml文件包含一些默认设置,但应在应用程序的WEB-INF目录中放置的centrifydc.xml文件副本中修改这些默认设置。下表介绍了可以在centrifydc.xml文件中设置的元素
如果您需要任何进一步的帮助,请随时直接联系Centrify技术支持。有几个问题。第一个是server.xml文件中的错误。JAASRealms可以为角色和用户接受多个类,因此属性为roleClassNames和userClassNames,如下所示
<Realm className="org.apache.catalina.realm.JAASRealm"
appName="CENTRIFYDC"
roleClassNames="com.centrify.dc.tomcat.RolesPrincipal"
userClassNames="com.centrify.dc.tomcat.LoginPrincipal" />
第二个问题是使用几个使用不同授权的应用程序。当应用程序首次通过身份验证时,centrifydc.xml文件映射角色。但是,如果启用了org.apache.catalina.authenticator.SingleSignOn,则仅为执行身份验证的应用程序设置角色。此后,仅设置身份验证应用程序的centrifydc.xml文件中设置的角色。其他应用程序将看到用户已通过身份验证,但没有必要的授权,并会出现403错误
在不同的应用程序中,使用角色user、user和manager,然后登录应用程序在进行身份验证时必须设置所有三个角色。谢谢。这里有很多有用的信息,特别是关于过滤器的使用。