2015-04-17 24 views
0

我有一个运行在Tomcat上的Java应用程序,并使用Waffle进行活动目录的验证。我的要求是在此应用程序中使用托管的某些其他网址,而无需对图片进行任何验证如何从华夫饼认证中排除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> 

我怎样才能做到这一点?

回答

0

只需添加一个第二个约束不保护这样的:

<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://github.com/dblock/waffle/blob/master/Docs/tomcat/TomcatMixedSingleSignOnAndFormAuthenticatorValve.md

+0

什么具体使URL不受保护? –

+0

不知道,它在文档 – mxb

+0

我认为重要的一点是省略''元素。 –