我可以让Google的OAuth2显示移动设备友好的审批页面吗?

dka*_*man 5 oauth-2.0

我正在开发一款可以使用OAuth2进行身份验证的移动应用.

它工作得很好但是当我导航到批准Uri时,谷歌正在返回看起来像一个完整的桌面应用程序批准页面.它看起来并不太糟糕,但我更愿意获得你可以要求Google的OAuth 1显示的精简版移动版本.

(来自http://code.google.com/apis/accounts/docs/OAuth_ref.html)

btmpl

(optional) Forces a mobile version of the approval page. The only accepted value is "mobile". This is a Google-specific parameter.
Run Code Online (Sandbox Code Playgroud)

我已经尝试将其添加到OAuth2批准Uri但不高兴.因此,如果我使用Google安装的应用程序身份验证流程,是否有任何选项可以指示请求来自小屏幕设备?

我正在使用的oauth端点:

https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=http://localhost&scope=https://www.googleapis.com/auth/userinfo.profile&client_id=XXXXXXX.apps.googleusercontent.com
Run Code Online (Sandbox Code Playgroud)

Nic*_*ier 1

您所引用的 OAuth 2.0 URL 已有适合移动设备的版本。但是,与 OAuth 1.0 URL 不同,没有 URL 参数来强制它,而是使用用户代理检测来根据浏览器显示适当的版本。至少它在我的 Android 设备上运行良好(不过我还没有尝试过任何其他设备)。