0
當登錄到Auth0:當通過refresh_token在Auth0,日本菸草國際公司(JWT ID)更新id_token沒有新id_token
POST https://my.auth0.com/oauth/ro
{
"client_id": "<client-id>",
"username": "[email protected]",
"password": "••••••••",
"connection": "<auth0-connection>",
"grant_type": "password",
"scope": "openid offline_access jti email",
"device": "<device-id>"
}
// Response
{
"refresh_token": "<refresh-token>",
"id_token": "<id-token>",
"access_token": "<access-token>",
"token_type": "bearer"
}
// id_token JWT payload
{
"jti": "3d4c5e97-3543-4c53-b46e-3aa965cd5a34",
"email": "[email protected]",
"email_verified": false,
"iss": "https://my.auth0.com/",
"sub": "auth0|<id>",
"aud": "<aud>",
"exp": 1481766419,
"iat": 1481730461
}
如果我指定我的範圍jti
,返回id_token
,這是一個智威湯遜,將包含jti
。 Auth0推薦在智威湯遜擁有jti
。 jti
s唯一標識智威湯遜,可用於黑名單智威湯遜等事情。
出於某種原因,不過,如果我嘗試使用刷新標記獲得新的id_token
:
POST https://my.auth0.com/delegation
{
"client_id": "<client-id>",
"grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
"refresh_token": "<refresh-token>",
"api_type": "app",
"scope": "openid offline_access jti email",
"device": "<device-id>"
}
// Response
{
"token_type": "Bearer",
"expires_in": 35958,
"id_token": "<id-token>"
}
// id_token JWT payload
{
"email": "[email protected]",
"email_verified": false,
"iss": "https://my.auth0.com/",
"sub": "auth0|<id>",
"aud": "<aud>",
"exp": 1481766678,
"iat": 1481730720,
"azp": "<azp>"
}
即使我指定我的範圍jti
,返回不包含jti
的id_token
。
這是一個錯誤?請幫忙。
謝謝!你是對的,有一個規則設置jti。我應該使用什麼端點來使用我的refresh_token獲取新的id_token?我使用{grant_type:「refresh_token」,refresh_token:}嘗試了https://dev-innit.auth0.com/oauth/token,並得到了不受支持的_grant_type。我寧願使用正確的端點,而不是創建自己的JWT ID屬性。 –
enamrik
爲了使用授權類型爲'refresh_token'的'/ oauth/token',您需要在高級帳戶設置中啓用* OAuth 2.0 API授權*,然後還可以在客戶端啓用* OIDC Conformant *標誌應用級別。但是,儘管如此,我不認爲在刷新令牌端點時目前支持規則,因此您無法將聲明添加到該值。目前,自定義聲明名稱和委派端點的使用是可用的。 –
謝謝,這真的很清楚和直接。我將使用'/ delegation'端點,直到'/ oauth/token'支持自定義聲明。 – enamrik