OAuth 2 - The first sight
傳統client-server的服務架構,取得受保護資源通常需要向server提供username/password做Authentication。若server又要提供第三方資源給client, 則可以導入Authorization,進而給予不同程度的授權。 Authentication的安全性問題可以讓client預先設定redirection URI或者是讓resource owner確認client身份。 Client 可由 authorization_code password client_credentials refresh_token 其中一中grant_type去取得 Access token 核發Access Token 會帶有以下內容 access_token token_type e.g.: Bearer expired_in 幾秒過期 scope 授權範圍 refresh_token refresh_token 可用來申請新的access token,於過期、權限不足...等狀況中使用。在換發新的access token 同時, 因安全考量server也必須將舊的refresh token撤銷。 reference: https://blog.yorkxin.org/posts/oauth2-1-introduction.html