[英]Waffle JAAS Authentication
我正在尝试将华夫饼集成到我的Web应用程序项目(jsp)中。 我想从Active Directory(遵循Kerberos协议)对我的Web应用程序进行用户身份验证。
每当用户提示URL时,tomcat服务器首先从Active Directory服务器对用户进行身份验证,身份验证后,用户便可以使用我的Web应用程序(jsp)。
这是我实施华夫饼所遵循的设置。 成功登录后,当我点击该网址时,弹出弹出窗口进行验证
HTTP状态403-对请求资源的访问已被拒绝
的context.xml
<Context>
<Realm className="org.apache.catalina.realm.JAASRealm"
appName="Jaas"
userClassNames="waffle.jaas.UserPrincipal"
roleClassNames="waffle.jaas.RolePrincipal"
useContextClassLoader="false"
debug="true" />
</Context>
web.xml中
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Jaas</realm-name>
</login-config>
<security-role>
<role-name>Everyone</role-name>
</security-role>
<security-constraint>
<display-name>Waffle Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Everyone</role-name>
</auth-constraint>
</security-constraint>
login.conf的
Jaas {
waffle.jaas.WindowsLoginModule sufficient;
};
jaas.policy
grant Principal * * {
permission java.security.AllPermission "/*";
};
我尝试了以下配置,它对我有用。
<security-role>
<role-name>*</role-name>
</security-role>
<security-constraint>
<display-name>Waffle Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.