2015-04-17 23 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

我認爲重要的一點是省略''元素。 –