我有一个Java应用程序,它运行在Tomcat上,并使用Waffle与active directory进行身份验证。我的要求是使用此应用程序中托管的某些rest url,而无需任何身份验证进入图片。
配置设置如下。
context.xml (Tomcat)
<Valve className="waffle.apache.NegotiateAuthenticator"
principalFormat="fqn" roleFormat="both"/>
<Realm className="waffle.apache.WindowsRealm"/>web.xml
<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>我如何才能做到这一点?
发布于 2015-05-18 17:00:46
只需添加第二个未保护的约束,如下所示:
<security-constraint>
<display-name>Login Page</display-name>
<web-resource-collection>
<web-resource-name>Unprotected Login Page</web-resource-name>
<url-pattern>/login.jsp</url-pattern>
</web-resource-collection>
</security-constraint>我可能还需要在context.xml文件中使用混合身份验证:
<Context>
<Valve className="waffle.apache.MixedAuthenticator" />
<Realm className="waffle.apache.WindowsRealm" />
</Context>但是,我们也可以让它与waffle.apache.NegotiateAuthenticator一起工作。
https://stackoverflow.com/questions/29691420
复制相似问题