4

I am accessing Google APIs from a native iOS app (using gtm-oauth2) and from my web app, which each have different client ids.

When I try to refresh the access tokens with refresh tokens created by a different client id of the one it was initially generated with, I get an authorization error.

I don't want users to be required to allow access to my app more than once.

Is it possible to make both client ids work interchangeably? Or is there a way to use the web's client id on the iOS platform (with gtm-oauth2 or without)?

hyotam
  • 141
  • 3

1 Answers1

0

I think you need to understand a little about how Oauth2 works.

When a user grates you access to there data they are granting it to your Application. In order to do that Oauth2 needs to know what application is requesting access. The application is identified to Oauth2 by its client id. The Access token Refresh token is made for the specific application.

By having two different client ids you have two different applications and the refresh tokens cant be interchanged

I haven't tried this but it might work. Have you tried using the client id from your web app in the IOS app? If it does / or doesn't work I would love to know for future reference.

I hope this helps.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449