2
我正在通過this article並陷入了一個問題。想象一下,我已經在web.xml中以下規則:防止Google App Engine在使用安全約束時記住非管理用戶的會話
<security-constraint>
<web-resource-collection>
<web-resource-name>Admin access</web-resource-name>
<url-pattern>/AdminPanel.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
然後非管理員用戶打開AdminPanel.jsp,GAE重定向他谷歌帳戶登錄頁面,他進入他的證件和邏輯得到這個頁面
Error: Forbidden
Your client does not have permission to get URL /AdminPanel.jsp from this server.
現在我不能重新登錄與其他谷歌帳戶,因爲我仍然認證爲錯誤的用戶和 GAE把ACSID cookie中的應用網址。我會一直收到上面提到的錯誤消息。有沒有辦法優雅地解決這個問題?我希望客戶能夠使用適當的憑證重新登錄。客戶登錄多個帳戶時的情況也是可能的。我個人擁有Google Apps帳戶和Gmail帳戶。所有Google應用程序(例如GMail)都可以選擇在賬戶間切換。我能做同樣的事嗎?