Passport.js 中的刷新令牌 [英] Refresh token in Passport.js

查看:63
本文介绍了Passport.js 中的刷新令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Passport.js 中执行此操作?:

How do I do this in Passport.js?:

访问令牌过期时,您可以使用refresh_token刷新"您的访问权限,并获得另一个 access_token.要使用refresh_token 你需要对我们的令牌端点做一个 POST 请求grant_type 设置为 refresh_token:

When the access token expires, you can use the refresh_token to "refresh" your access, and gain another access_token. To use the refresh_token you need to do a POST request to our token-endpoint with the grant_type set to refresh_token:

https://podio.com/oauth/token?grant_type=refresh_token&client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&refresh_token=REFRESH_TOKEN

推荐答案

我问 Jared,他是否会考虑在核心中添加一些东西,让这件事更容易处理.他回应说,这不应该在核心处理.

I asked Jared if he would consider adding something into the core to make this a little easier to handle. He responded by saying that this should not be handled in the core.

所以我写了一个插件来帮助:https://github.com/fiznool/passport-oauth2-刷新

So I wrote a plugin to help: https://github.com/fiznool/passport-oauth2-refresh

这篇关于Passport.js 中的刷新令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆