XQuery/OAuth
外觀
< XQuery
您想登入到支援 OAuth 協議的 Web 服務。
OAuth 是一種開放協議,允許從桌面和 Web 應用程式以簡單且標準的方式進行安全的 API 授權。與 OpenID 一樣,OAuth 允許其他 Web 服務使用您的私人資料,而無需提供您的密碼。
消費者金鑰 - 當您以開發者身份在 OAuth 服務提供商處註冊時,他們會向您傳送一個 API 金鑰,供您在其服務中使用。這通常是一個大約 65 個字元的字串,由數字和字母組成。
服務提供商 - 像 LinkedIn、Google 或 Twitter 這樣的組織,它們擁有一些受 Web 服務保護的您的資料。
令牌 - 在 AOuth 資料交換中使用的一種相當長的計算機生成的字母和數字字串。這些字串難以猜測,並且與一個金鑰配對,以防止令牌被未經授權的方使用。OAuth 定義了兩種型別的令牌:請求令牌和訪問令牌。
我們將按以下步驟執行此過程
- 請求令牌
- 簽名
- 等等。
以下是一個包含 OAuth 資訊的結構示例(來自 28msec 網站)
<oa:service-provider realm="example.com/oauth">
<oa:request-token>
<oa:url></oa:url>
<oa:http-method>GET</oa:http-method>
</oa:request-token>
<oa:user-authorization>
<oa:url></oa:url>
</oa:user-authorization>
<oa:access-token>
<oa:url></oa:url>
<oa:http-method>GET</oa:http-method>
</oa:access-token>
<oa:supported-signature-methods>
<oa:method>HMAC-SHA1</oa:method>
</oa:supported-signature-methods>
<oa:oauth-version>1.0</oa:oauth-version>
<oa:authentication>
<oa:consumer-key>your consumer key</oa:consumer-key>
<oa:consumer-key-secret>your consumer secret</oa:consumer-key-secret>
</oa:authentication>
</oa:service-provider>
- 來自 Joe Wicentowski 的 OAuth 和 Twitter XQuery 模組示例
- Joe Wicentowski 在 eXist 上關於如何使用 OAuth 透過 XQuery 訪問 Twitter 的優秀文章
- http://oauth.net/
- http://hueniverse.com/2007/10/beginners-guide-to-oauth-part-ii-protocol-workflow/
- http://sausalito.28msec.com/latest/index.php?id=working_with_oauth
- 服務提供商結構的 XML 定義示例
- MarkLogic Facebook OAuth 模組
- Norm Walsh 關於 OAuth 的文章
- 用於 BaseX 的 OAuth
- Google 開發者 API