Different oauth2 native / web client identifiers for the same application

I access the Google APIs from my native iOS application (using gtm-oauth2) and from my web application, each of which has different client identifiers.

When I try to update access tokens with update tokens created by another identifier of the client from which it was generated, I get an authorization error.

I do not want users to be required to allow access to my application more than once.

Is it possible that both client identifiers work interchangeably? Or is there a way to use the web client identifier on the iOS platform (with or without gtm-oauth2)?

+4
source share
1 answer

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

When a user grants you access to data, they provide this application. To do this, Oauth2 needs to know which application is requesting access. The application is identified by Oauth2 by its client ID. The access token update current is for a specific application.

Having two different client identifiers, you have two different applications, and update tokens cannot be replaced

I haven't tried it, but it might work. Have you tried to use the client ID from your web application in an iOS app? If this does or does not work, I would like to know what needs to be done in the future.

Hope this helps.

0
source

Source: https://habr.com/ru/post/1534210/


All Articles