没有提示使用OAUth2重新认证.为什么以及如何强制呢? [英] No prompt for re-authentication with OAUth2. Why and how to force it?

查看:97
本文介绍了没有提示使用OAUth2重新认证.为什么以及如何强制呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解一点. 我有一个基于oAuth2的Google帐户应用程序.

I would like to understand something please. I have an application based on oAuth2 with Google Accounts.

因此,当我第一次连接到该网站时,我被重定向到Google域上的身份验证页面.因此,我键入我的电子邮件和密码,并且不选中受信任的计算机"(或记住我",我不记得确切的用语).

So, teh first time I connect to this website, I am redirected to the authentication page on Google domain. So I type my email and password and I dont check "trusted computer" (or "remember me", I dont remember the exact term).

问题是,如果我重新启动计算机甚至删除了Cookie(但没有删除我的历史记录(在Android手机上使用Chrome浏览器进行了测试),则不会再次提示我进行身份验证,并且我可以直接访问该应用程序.

The thing is if I reboot my computer or even delete my cookie (but not my history (tested with Chrome on Android phone), I am not prompted again for the authentication and I have directly access to the application.

我想了解为什么? 如果有人可以向我解释,那就太好了!

I would like to understand why ? If somebody can explain it to me that should be great !

谢谢

推荐答案

您实际上可以通过将&max_auth_age=0传递给身份验证URL来强制在Google OAuth api中进行重新身份验证.

You can actually force re-authentication in the Google OAuth api by passing &max_auth_age=0 to the auth URL.

来源:

使用PAPE扩展名进一步控制用户身份验证(可选) 在PAPE扩展名中使用max_auth_age参数,以确保用户在Google上的登录会话是最近的.您也可以指定max_auth_age = 0强制重新输入密码.

Use the PAPE extension for further control of user authentication (optional) Use the max_auth_age parameter in the PAPE extension to ensure that the login session of the user at Google is recent. You may also specify max_auth_age=0 to force a password reprompt.

https://developers.google.com/accounts/docs/OpenID

这有点令人困惑,因为他们谈论OpenID,但是我已经通过Google提供的OAuth2库成功地做到了这一点.

It's a bit confusing because they talk about OpenID, but I'm doing this successfully with Google's provided OAuth2 libs.

这篇关于没有提示使用OAUth2重新认证.为什么以及如何强制呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆