簡體   English   中英

OAuth 2中的訪問令牌和auth_codes之間有什么區別

[英]What is the difference between access tokens and auth_codes in OAuth 2

我正在使用OAuth 2.0 PHP庫在PHP中開發OAuth 2.0服務器。

在該庫的示例中,我可以看到3個表: auth_codesclientstokens

據我所知,令牌用於訪問數據,auth代碼用於獲取令牌。

但問題是,如果我這樣做

...authorize.php?client_id=0123456789ab&response_type=token&state=test_state

我甚至無需獲取訪問代碼就可以獲得令牌。

怎么可能? 這是一個正確的實施嗎?

OAuth2身份驗證有兩種流程。

  1. 兩條腿OAuth
  2. 三足OAuth

在這里你遇到了兩條腿的OAuth ,它不需要auth_code來獲取access_token舞蹈:)

這些是一些有用的鏈接,可以幫助您更好地理解差異。

  1. http://cakebaker.42dh.com/2011/01/10/2-legged-vs-3-legged-oauth/
  2. https://sites.google.com/site/oauthgoog/2leggedoauth/2opensocialrestapi

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM