首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >华夫饼JAAS认证

华夫饼JAAS认证
EN

Stack Overflow用户
提问于 2018-01-09 12:26:31
回答 1查看 319关注 0票数 2

我正在尝试将华夫饼集成到我的web应用程序项目(jsp)中。我想从活动目录(遵循Kerberos协议)验证我的webapp的用户。

每当用户提示url首先从活动目录服务器对用户进行身份验证时,用户就可以使用我的web应用程序(jsp)。

下面是我为实现华夫饼所遵循的设置。当我点击url弹出以便在成功登录后进行验证时,它显示

HTTP状态403 -对请求的资源的访问已被拒绝,

context.xml

代码语言:javascript
复制
    <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

代码语言:javascript
复制
      <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

代码语言:javascript
复制
    Jaas {
    waffle.jaas.WindowsLoginModule sufficient;
};

jaas.policy

代码语言:javascript
复制
    grant Principal * * {
  permission java.security.AllPermission "/*";
};
EN

回答 1

Stack Overflow用户

发布于 2018-10-17 06:07:08

我尝试了下面的配置,它对我是有效的。

代码语言:javascript
复制
<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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48168218

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档