question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

manually refreshing a token

See original GitHub issue

I’m having trouble refreshing tokens. I keep getting { [Error: internal_failure] code: 500 } for the error. The refreshToken I’m supplying is valid. I am setting the credentials before calling this method:

oAuth2Client.refreshAccessToken(function(err, tokens) {
   console.log(err, tokens);
});

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JustinBeckwithcommented, Mar 15, 2018

Greetings folks! There’s a great example of refreshing the access token here: https://github.com/google/google-auth-library-nodejs/blob/master/examples/refreshAccessToken.js

If you still have trouble, let us know!

0reactions
janvdacommented, Dec 24, 2019

@bcoe thanks for the response

My issue:

I would like to use the google photos API. For this I am using 1/ https://github.com/roopakv/google-photos + 2/ for the google authentication I am using this library (= https://github.com/googleapis/google-api-nodejs-client).

I don’t know how I can use 2/ to refresh the access token so that I can pass that to 1/. The problem with 2/ is that it is automatically refreshing the access token when using the google APIs provided by 2/ but I am not using any of the google APIs provided by 2/.

Note also that 2/ doesn’t provide the google photos API which is the only API I want to use !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Refresh Tokens - OAuth 2.0 Simplified
To use the refresh token, make a POST request to the service's token endpoint with grant_type=refresh_token , and include the refresh token as ......
Read more >
Understanding Refresh Tokens
A refresh token can be requested by an application as part of the process of obtaining an access token. Many authorization servers implement...
Read more >
Should access tokens be refreshed automatically or ...
Manually Refreshing ​​ User authenticates with username and password. The API sends back a short lived access token containing his data, and a ......
Read more >
Refreshing a Token
Rotating refresh tokens reduces their attack surface because there is a chance that a stolen token will be unusable by the attacker. If...
Read more >
Refresh Access Token | ReadyAPI Documentation
Process overview ; Automatic, Manual ; Refresh token exist, ReadyAPI automatically updates the access token using the refresh token. You need to click...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found