【发布时间】:2014-06-26 02:17:03
【问题描述】:
我正在寻找为我的客户 [web-java 脚本/mob-android 应用程序] 提供安全性的最佳方式,以便授权用户/机器只能访问我的应用程序。在 google 上搜索时,我发现我可以使用 google 提供的 OAuth 2.0 进行授权,
[1] 是否建议使用 OAuth 2.0?
首先在 OAuth 2.0 中,我们必须使用 google console 为客户端创建一个令牌,并且可以在 java 脚本客户端 give here 中使用该客户端 ID
[2] 在 web 客户端上,令牌存储在哪里?
在developer site 上他们已经给了这个
You should write your code to anticipate the possibility that a granted token might no longer work. A token might stop working for one of these reasons:
The user has revoked access.
The token has not been used for six months.
The user account has exceeded a certain number of token requests.
There is currently a 25-token limit per Google user account. If a user account has 25 valid tokens, the next authentication request succeeds, but quietly invalidates the oldest outstanding token without any user-visible warning.
If you need to authorize multiple programs, machines, or devices, one workaround is to limit the number of clients that you authorize per user account to 15 or 20. If you are a Google Apps admin, you can create additional admin users and use them to authorize some of the clients.
使用 oAuth2.0 我需要有 goole、facebook 帐户或从我的自定义域帐户说 www.mysite.com/usr1 我可以进行身份验证?
问题
[3] 生成令牌后,我们可以控制其生命周期(如何?)还是仅在六个月后过期?
[4] 对于每个 google 帐户用户,我可以生成 25 个令牌或为我的 google 账号(我用来创建控制台项目的账号)我可以生成25个token?
[5] 同一个令牌可以用于多个 Web 客户端用户吗?
访问令牌的生命周期有限。如果您的应用程序需要在单个访问令牌的生命周期之外访问 Google API,它可以获得刷新令牌。刷新令牌允许您的应用程序获取新的访问令牌。
[6] 访问令牌是否与我从控制台生成的相同?
[7] 我可以从哪里获得刷新令牌?
任何帮助将不胜感激!!!
提前致谢
【问题讨论】:
标签: java android google-app-engine oauth