本文介紹了Auth0中的id_token和access_token有什么區別的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
在 Auth0 中,您可以使用 刷新令牌.在這個鏈接中,我們可以看到很多返回的參數:
In Auth0 you can use refresh tokens. In this link, we can see many returned parameters:
lock.showSignin({
authParams: {
scope: 'openid offline_access'
}
}, function (err, profile, id_token, access_token, state, refresh_token) {
// store refresh_token
});
顯然,access_tokens 可用于檢索用戶配置文件數據.但這似乎是oauth特有的,我認為auth0使用openid?
Apparently, access_tokens can be used to retrieve user profile data. But this appears to be specific to oauth, and I thought auth0 uses openid?
id_token
和access_token
有什么區別?
推薦答案
OpenID Connect 建立在 OAuth2 之上.
OpenID Connect is built on top of OAuth2.
access_token
可用于調用 Auth0 中的某些 API(例如/userinfo
)或您在 Auth0 中定義的 API.id_token
是 JWT,代表登錄用戶.您的應用程序經常使用它.refresh_token
(僅供移動/桌面應用程序使用)不會過期(但可撤銷),它允許您獲得新鑄造的access_tokens
和id_token
.
- An
access_token
is useful to call certain APIs in Auth0 (e.g./userinfo
) or an API you define in Auth0. - An
id_token
is a JWT and represents the logged in user. It is often used by your app. - A
refresh_token
(only to be used by a mobile/desktop app) doesn't expire (but is revokable) and it allows you to obtain freshly mintedaccess_tokens
andid_token
.
這篇關于Auth0中的id_token和access_token有什么區別的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!