开发者

authentication redirect with offline webapp (gae python, html5)

开发者 https://www.devze.com 2023-03-05 16:06 出处:网络
To GAE+html5 gurus out there :) When user logs on to a GAE hosted application, his credentials are stored locally in a cookie (correct?).

To GAE+html5 gurus out there :)

When user logs on to a GAE hosted application, his credentials are stored locally in a cookie (correct?).

After this cookie expires (e.g. if users hits logout on another browser tab), no login_required protected methods will work.

Regular webapp will require re-authentication next time the user navigates to a login_protected url by automatically redirecting to a login screen.

What would be the right way for a cached webapp to be handling this?

My test is a simple login_protected 开发者_如何学Gopage accessed by Chrome and iOS browser. It's cached and accessible offline as expected. Then, (while online) and after the authentication expires, the server log shows a 302 response which is followed by 200 response of the authentication dialog page, but of course no authentication happens.

Thanks!


If you are using google authentication to provide access to your page . Which means even if you are logged in one of the other google services. Your cookie still exists in the browser. login_required will assume that you are logged on based on the cookie. What you are seeing is a redirection to google's page that's 302. If you want you can manage sessions on your own and check for authentication based on your data in data Store.There are lot of solutions availble for both Python and Java .

0

精彩评论

暂无评论...
验证码 换一张
取 消