"Token has been expired or revoked."

250 views
Skip to first unread message

Cricket Testers

unread,
Oct 20, 2021, 10:50:08 AM10/20/21
to Firebase Google Group
I am trying to do refresh_token via postman, to use the access token, which gets expired after 1 hr, it seems it is not working, I am getting error:
    "error": "invalid_grant",
    "error_description": "Token has been expired or revoked."

my oauth consent is production..

please can someone help

Rodrigo de França Miss Nairnei

unread,
Oct 20, 2021, 2:50:06 PM10/20/21
to Firebase Google Group
I probably won't bring you an answer, but maybe some ideas that you can follow

Why you need refresh token via postman? request a new token on automatization.

On the front through the client's sdk you can get the token automatically refresh from user
 
something like this:
var tokenToSendOnHeader = yourUserFirebase.getIdToken();

And you can see this:
https://developers.google.com/identity/toolkit/reference/securetoken/rest/v1/token

Att. 

Cricket Testers

unread,
Oct 21, 2021, 12:11:11 AM10/21/21
to Firebase Google Group
Hi Rona, well thanks for at least reverting to me.

This is part of automation, I am calling the postman scripts via pipelines to update the firebase remote config.
Now as per googleapis, remote auth will only work with OAuth token, and for Oauthtoken, it needs a google oauth clientid, the oauth token will not work for service or user account, so the above method suggested will not work.

Every time I need to post a new config in firebase, I need OAuth access token in the form of bearer token which I receive from the postman, and I want this to be automated, so I don't have to click the Get access token everytime manually via postman to access the google forebase rest api.
postman.PNG
Reply all
Reply to author
Forward
0 new messages