簡體   English   中英

Waffle JAAS認證

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM