授權結果
獲取access_token成功, 訪問資源服務器API
http://localhost:9000/api-gateway-engine/unity/user_info?access_token=94d129e7-7898-4084-9c08-6bfe27a2521e
准備工作
一、授權過程
FirewalledRequest[ Request(POST //10.200.44.82:9000/api-gateway-engine/oauth/token)@6406550f]
1、身份識別
2、權限檢查
org.springframework.security.access.vote.AuthenticatedVoter@4d4dfe95
3、授權處理
3.1、授權入口
請求參數
ClientCredentialsTokenGranter.grant("client_credentials",tokenRequest)
org.springframework.security.oauth2.provider.client.ClientCredentialsTokenGranter@97e8aa0
3.2、獲取數據庫中的oauth_client_details信息
3.3、創建OAuth2Authentication對象(根據storedOAuth2Request對象(client+tokenRequest))
3.4、構建storedOAuth2Request(根據client和tokenRequest)
3.5、如果已經存在access_token, 更新數據庫返回
二、結果驗證
1、授權結果
第二步 訪問資源服務器的API
access_token
94d129e7-7898-4084-9c08-6bfe27a2521e
token_type
bearer
scope
read write
expires_in
2591843
獲取access_token成功, 訪問資源服務器API
http://localhost:9000/api-gateway-engine/unity/user_info?access_token=94d129e7-7898-4084-9c08-6bfe27a2521e
JSON格式的資源服務器數據
2、訪問業務