2

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)?

abhijeetgurle
  • 751
  • 6
  • 11
  • 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 https://stackoverflow.com/q/24454137/1841839 – Linda Lawton - DaImTo Feb 13 '20 at 08:07
  • Actually I want to access google API's on backend. Hence I want a rest API which will give me refresh token. – abhijeetgurle Feb 13 '20 at 11:07
  • 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. – Linda Lawton - DaImTo Feb 13 '20 at 11:08
  • 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 Feb 13 '20 at 11:20
  • 1
    @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 Feb 14 '20 at 07:23
  • Did you find a solution on how to get the refresh token on user first sign in? – Arif Apr 04 '22 at 10:40

1 Answers1

0

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.

abhijeetgurle
  • 751
  • 6
  • 11
  • How do you get the refresh token when you login the first time? I can see an access token but I am not able to see any refresh token – Arif Apr 04 '22 at 10:23