Contenu connexe Similaire à 從Google API到Google Analytics 2016寒假宅學營 (20) 從Google API到Google Analytics 2016寒假宅學營4. API
3
• Application Programming Interface(應用程式介面),就是
軟體系統不同組成部分銜接的約定。
• 由於近年來軟體的規模日益龐大,常常會需要把複雜的系統
劃分成小的組成部分,因此API的設計十分重要。
• 良好的API設計可以降低系統各部分的相互依賴,提高組成
單元的內聚性,降低組成單元間的耦合程度,進而提高系統
的維護性和擴展性。
好的API不會讓你上天堂,但可減輕你的負擔
31. OAuth 2.0 實作
30
Service 支援的 Grant Types Client 認證
Google Authorization Code, Implicit POST
Facebook
Authorization Code, Implicit, Client
Cred.
GET
建立開發者專用金鑰
40. Google Analytics API 應用
39
因此有了Google Analytics API我們能夠透過Oauth2.0驗證取得Google
Analytics服務下的各樣資訊,方便我們網站做更多的規劃。
42. 參考資料
41
• The OAuth 2.0 Authorization Framework
• Social Login Trends Across the Web: Q1 2015
http://janrain.com/blog/social-login-trends-across-the-web-q1-2015/
• 第一次接觸Google API就上手
http://www.ithome.com.tw/guest-post/98590
• 理解OAuth 2.0
http://www.ruanyifeng.com/blog/2014/05/oauth_2_0.html
• OAuth 2.0 筆記
https://speakerdeck.com/chitsaou/jian-dan-yi-dong-de-oauth-2-dot-0
Notes de l'éditeur 廣義 例子 授權碼模式(authorization code)是功能最完整、流程最嚴密的授權模式。它的特點就是通過客戶端的後台服務器,與"服務提供商"的認證服務器進行互動。 (C) 假設 Resource Owner 許可了存取申請, Authorization Server 會把 User-Agent 轉回去先前指定的 Redirection URI ,其中包含 Access Token ,放在 Fragment Component 裡面。
(D) User-Agent 跟隨轉址的指示,發出 Request 到 Web-Hosted Client Resource ,這個 Request 裡面不會有剛剛拿到的 Fragment , User-Agent 自己保留 Fragment 。(註)
(E) Web-Hosted Client Resource 回傳一個網頁(HTML & JavaScript),這個網頁可以拿到完整的 Redirection URI (含先前 User-Agent 保留的 Fragment)、把 Fragment 裡面的 Access Token 和其他參數給解出來。(註)