名稱、識別字 | 獲得 AccessToken |
功能描述 | 根據 clientId 、secret 、scope 值 獲得 AccessToken |
URL | https://sso.foxconn.com/connect/token |
Method | POST 方法 |
Content Type | application/x-www-form-URL encoded |
Parameters |
client_id=[ClientID]& client_secret=[密碼明文]& grant_type=client_credentials & scope=[權限范圍] |
說明
|
|
Response Body |
{ "access_token": "......", "expires_in": 3600, "token_type": "Bearer", "scope": "civet.api.emp c114.phone.ext" } |
補充說明 | 參考: https://sso.foxconn.com/Developer/Document/OIDC#token |
名稱、識別字 | 獲得 AccessToken |
功能描述 | 根據 clientId 、secret 、code 值 獲得 AccessToken |
URL | https://sso.foxconn.com/connect/token |
Method | POST 方法 |
Content Type | application/x-www-form-URL encoded |
Parameters |
client_id=[ClientID]& client_secret=[密碼明文 ]& grant_type=authorization_code& code=[code 值 ]& redirect_uri=[重定向路徑 ] |
說明
client_id:您的 ClientID client_secret:您的明文密碼 grant_type:此處固定為 authorization_code code:第一步登錄時獲取到的 code 值 redirect_uri:與第一步重定向路徑需一致 |
|
Response Body |
{
"access_token": "eyJhbGciOiJSUz.......", "token_type": "Bearer", "expires_in": 3600, "scope": "openid profile civet.api.emp" } |
說明 access_token:AccessToken scope:在獲取token時加上offline_access,可以獲取RefreshToken。 expires_in:有效時間(秒),負責人可通過 https://sso.foxconn.com/developer 修改 |
|
補充說明 | 參考: https://sso.foxconn.com/Developer/Document/OIDC#token |
名稱、識別字 | 刷新 AccessToken |
功能描述 | 使用 RefreshToken 刷新 AccessToken |
URL | https://sso.foxconn.com/connect/token |
Method | POST 方法 |
Content Type | application/x-www-form-urlencoded |
Parameters |
client_id=[ClientID]& client_secret=[密碼明文]& grant_type=refresh_token& refresh_token=[RefreshToken] |
說明 client_id :您的 ClientID client_secret :您的明文密碼 grant_type: 固定值為refresh_token refresh_token :獲取access_token 時scope 包含offline_access 時返回的refresh_token 的值 |
|
Response Body |
{ "access_token": "eyJhbGciOiJSUz.......", "expires_in": 3600, "token_type": "Bearer", "refresh_token": "2C1292A6133.......", "scope": "openid profile civet.api.emp offline_access" } |
說明 access_token :刷新的 AccessToken expires_in :有效時間(秒),負責人可通過 https://sso.foxconn.com/developer 修改 |
|
補充說明 | 參考:https://sso.foxconn.com/Developer/Document/OIDC#token |