To determine when to use a refresh token to ask for a new access token, I'm aware of two approaches (below). Are either of these approaches possible without modifying the passport-google-oauth library?
1) The "pre-emptive" method
2) The "handle failure" method
Thanks. Also welcome any alternatives.
我写了一个插件,使处理这个更容易: https : //github.com/fiznool/passport-oauth2-refresh
Note that Passport does not actively use the access token or refresh token, other than to fetch the user profile during login. You're application is responsible for using these tokens when making whatever API requests are necessary. As such, you can implement either method you describe, Passport is not involved in the process.
See also: https://github.com/jaredhanson/passport-google-oauth/issues/23
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.