简体   繁体   English

Waffle JAAS认证

[英]Waffle JAAS Authentication

I am trying to integrate waffle in my web app project (jsp). 我正在尝试将华夫饼集成到我的Web应用程序项目(jsp)中。 I want to authenticate user for my webapp, from Active directory(following Kerberos protocol ). 我想从Active Directory(遵循Kerberos协议)对我的Web应用程序进行用户身份验证。

Whenever user hint the url firstly tomcat server authenticate the user from Active directory server, upon authentication user can use my web application (jsp). 每当用户提示URL时,tomcat服务器首先从Active Directory服务器对用户进行身份验证,身份验证后,用户便可以使用我的Web应用程序(jsp)。

Here's the setting I followed for implementing waffle. 这是我实施华夫饼所遵循的设置。 When I hit the url pop up occur for verification after successful login it shows 成功登录后,当我点击该网址时,弹出弹出窗口进行验证

HTTP Status 403 - Access to the requested resource has been denied HTTP状态403-对请求资源的访问已被拒绝

context.xml 的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 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 login.conf的

    Jaas {
    waffle.jaas.WindowsLoginModule sufficient;
};

jaas.policy jaas.policy

    grant Principal * * {
  permission java.security.AllPermission "/*";
};

I tried the below configuration, it works for me. 我尝试了以下配置,它对我有用。

<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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM