[英]Using OAuth 2.0 (Authentication) token on GAE client
我正在尋找為我的客戶提供安全性的最佳方法[web-java腳本/ mob-android應用],以便授權用戶/機器只能訪問我的應用。 在google上搜索時,我發現可以使用google提供的OAuth 2.0進行授權,
[1]建議使用OAuth 2.0嗎?
在OAuth 2.0用戶在首先我們必須使用創建客戶端令牌谷歌的控制台 ,可以使用客戶端ID在Java腳本客戶給這里
[2]在Web客戶端上,令牌存儲在哪里?
在開發者網站上,他們給了
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個令牌?
[5]同一令牌可用於多個Web客戶端用戶嗎?
訪問令牌的壽命有限。 如果您的應用程序需要在單個訪問令牌的生存期之外訪問Google API,則可以獲取刷新令牌。 刷新令牌使您的應用程序可以獲得新的訪問令牌。
[6] Access令牌與我從控制台生成的令牌相同嗎?
[7]從哪里可以獲得刷新令牌?
任何幫助將不勝感激!!!
提前致謝
我使用oauth,oauth2和openid在我的GAE python應用程序上對我的用戶進行身份驗證,實現起來並不是很簡單,但是對於訪問者來說卻非常有用和簡單。
首先,您可以使用oauth 2.0游樂場嘗試使用oauth: https : //developers.google.com/oauthplayground/
有關Python的信息,請邀請您訪問此庫: https : //github.com/scotch/engineauth
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.