根据Auth0 Authentication API docs,您可以使用/oauth/ro
端点来交换刷新令牌的用户名和密码,如下所示:
{
"client_id": "...",
"grant_type": "password",
"device": "my-device",
"scope": "openid offline_access",
"username": "...",
"password": "...",
"connection": "Username-Password-Authentication"
}
工作正常。但是,由于我不会进入的原因,我在上下文中没有用户名和密码,但我确实有一个id令牌。
文档建议我可以使用相同的端点来交换刷新令牌的ID令牌。所以我尝试了这个:
{
"id_token": "...",
"client_id": "...",
"grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
"device": "my-device",
"scope": "openid offline_access"
}
但我得到400 Bad Request
:
{
"error": "invalid_request",
"error_description": "there is not an associated public key for specified client_id/user_id/device"
}
如何使用ID令牌从Auth0身份验证API获取刷新令牌?