2
votes

I am using angular fire auth and firebase API for performing authentication. I am getting access token for google API for the first time I log in, but I am not getting a refresh token for it. So can anyone guide on how should I get refresh token for refreshing access token when it expires (does Rest API exists)?

1
This might help but i dont know enough about angular to know. It would help if you would edit your question and include your code stackoverflow.com/q/24454137/1841839 - DaImTo
Actually I want to access google API's on backend. Hence I want a rest API which will give me refresh token. - abhijeetgurle
Rest APIs dont return refresh tokens. Authentication servers return refresh tokens you need to authenticate in order to get a refresh token even back end. - DaImTo
It sounds like what you're saying is that once the user logs into your client, you want them to stay logged in. So you need to get a valid auth token after the first expires while the user is still at the keyboard, but without interrupting them to log in again. Does that sound about right? - Prisoner
@Prisoner yeah thats right. I don't want users to log in again after access token expires. I have google's ID Token and access token. I also have firebase's Refresh token and ID token. - abhijeetgurle

1 Answers

0
votes

You get the refresh token only the first time you login using your app. To see the refresh token again revoke access to that app from your manage google account setting, and sign in again.