2012-10-02 75 views
0

我在做什麼是我的設置露天和共享會話超時60分鐘在他們的web.xml文件。會話超時後仍可以呼叫外面的web腳本嗎?

我的情況是

  1. 當我要開始啓動工作流頁面的工作流,我填寫的所有 必要的數據,但不要點擊「啓動工作流」按鈕。
  2. 會話超時後,我點擊這個「開始工作流程」按鈕。
  3. 第一次打開驗證框並請求用戶名爲 和密碼。
  4. 我填寫了另一個用戶的用戶名和密碼。
  5. 它啓動與認證的另一個用戶的工作流程。
  6. 對於會話超時的其他時間,它不會請求身份驗證 框,但會爲先前請求的身份驗證用戶起作用。

所以我覺得它爲什麼會發生???是因爲cookie嗎?

當前有四個使用的cookie,分別是alfLogin,alfUsername2,JSSESSIONID,_alfTest。只有當用戶註銷時,alfUsername2 cookie纔會被刪除,其他人將被保留.alfLogin和alfUsername2 cookies的過期時間爲7天,其他cookie則取決於會話。

會話超時後仍然可以使用露天網頁腳本嗎?如果是這樣,我該如何避免這種情況?

+0

你也許有你的露天倉庫會和你分享的Alfresco不同的會話超時?這可能解釋你所看到的症狀 – Gagravarr

回答

1

儘管我必須回答我自己的問題,但我只想分享我的結果。我必須追蹤很多。但答案很簡單。

首先,它不是因爲cookie。

這個答案不僅僅是點擊「開始工作流程」按鈕,而且在會話結束後會打電話給alfresco webscript共享

所有呼叫到戶外web腳本都是由EndPointProxyController完成,具體是org.springframework.extensions.webscripts.servlet.mvc.EndPointProxyControllerspring-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.xmlendpointController,改變 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>