How to use refresh_token along with access_token when xoauth2 authentication
See original GitHub issueIt seems when I use my access_token its working properly but how I can use my already saved in DB refresh_token?
req.gmail_client = new ImapClient("imap.gmail.com", 993, {
useSecureTransport: true,
auth:{
user: loggedInUser.gmail_address,
xoauth2:loggedInUser.access_token
},
enableCompression: true
});
I need it because when I use newly created access_token it seems working fine but later when I try again its showing me console error like:
[DEBUG][2016-05-03T03:51:53.292Z][undefined] S: W2 OK Success d64mb243647028itb
[DEBUG][2016-05-03T03:51:53.295Z][undefined] Server id updated! [object Object]
[DEBUG][2016-05-03T03:51:53.301Z][undefined] Logging in...
[DEBUG][2016-05-03T03:51:53.302Z][undefined] C: W3 AUTHENTICATE XOAUTH2 "(* value hidden *)"
[DEBUG][2016-05-03T03:51:54.098Z][undefined] S: W3 NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)
[ERROR][2016-05-03T03:51:54.104Z][undefined] Could not connect to server Error: Invalid credentials (Failure)
[DEBUG][2016-05-03T03:51:54.110Z][undefined] Entering state: 5
[DEBUG][2016-05-03T03:51:54.111Z][undefined] Closing connection...
Thanks in advance
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
What Are Refresh Tokens and How to Use Them Securely
Refresh token rotation is a technique for getting new access tokens using refresh tokens that goes beyond silent authentication. Refresh token ...
Read more >Refresh Tokens - OAuth 2.0 Simplified
The presence of the refresh token means that the access token will expire and you'll be able to get a new one without...
Read more >Authentication Using JWT and Refresh Token — Part 1.
The idea is to generate two tokens: an access token (valid for 10 minutes) and a refresh token ,with a longer lifetime.
Read more >Get access and refresh tokens - Microsoft Advertising API
Access token request details; Refresh token request details ... Start-Process "https://login.microsoftonline.com/common/oauth2/v2.0/ ...
Read more >Solved: Difference between Refresh token and Access token
A credential that a client uses to obtain new access tokens without requiring additional user authorization. An instance issues a refresh token ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
gmail app-specific password works nicely.
is this still current? if so, please re-open