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