儘管我必須回答我自己的問題,但我只想分享我的結果。我必須追蹤很多。但答案很簡單。
首先,它不是因爲cookie。
這個答案不僅僅是點擊「開始工作流程」按鈕,而且在會話結束後會打電話給alfresco webscript共享。
所有呼叫到戶外web腳本都是由EndPointProxyController
完成,具體是org.springframework.extensions.webscripts.servlet.mvc.EndPointProxyController
在spring-webscripts-1.0.0-sources.jar
。
在handleRequestInternal
方法中,如果沒有會話並且basicHttpAuthChallenge爲true,則基本驗證框如下所示。
else if (this.basicHttpAuthChallenge || descriptor.getBasicAuth())
{
// check for HTTP authorisation request (i.e. RSS feeds, direct links etc.)
String authorization = req.getHeader("Authorization");
if (authorization == null || authorization.length() == 0)
{
res.setStatus(HttpServletResponse.SC_UNAUTHORIZED,
"No USER_ID found in session and requested endpoint requires authentication.");
res.setHeader("WWW-Authenticate", "Basic realm=\"Alfresco\"");
// no further processing as authentication is required but not provided
// the browser will now prompt the user for appropriate credentials
return null;
}
else
{
// other coding
}
我們能夠避免這種情況的
在彈弓應用程序的context.xml的endpointController
,改變 basicHttpAuthChallenge爲false。
像
<!-- Override EndPointProxyController to enable Basic HTTP auth challenge on 401 response -->
<bean id="endpointController" class="org.springframework.extensions.webscripts.servlet.mvc.EndPointProxyController">
<property name="cacheSeconds" value="-1" />
<property name="useExpiresHeader"><value>true</value></property>
<property name="useCacheControlHeader"><value>true</value></property>
<property name="configService" ref="web.config" />
<property name="connectorService" ref="connector.service" />
<property name="supportedMethods"><null/></property>
<property name="basicHttpAuthChallenge"><value>false</value></property>
</bean>
你也許有你的露天倉庫會和你分享的Alfresco不同的會話超時?這可能解釋你所看到的症狀 – Gagravarr