I am developing an app in Android and IOS. I want to use the Google Sign In to login in the app.
In Android I use the client ID of the backend server, but in IOS I have to use the IOS app client ID to login.
Is not possible to use the backend server client ID in the IOS app?
Google Documentation
https://developers.google.com/identity/sign-in/ios/backend-auth
Regards
The JWT ID Token is only needed during Sign-in. We just need to validate it once during Sign-in like so: client. verifyIdToken({idToken: token, audience: CLIENT_ID}) . The ID Token is not used to Authenticate a user to My Web App.
On your iPhone or iPad, open the Safari app. Go to www.google.com. Tap your profile image or Sign in. Follow the sign-in steps.
The id_token is used in OpenID Connect protocol, where the user is authenticated as well as authorized. (There's an important distinction between authentication and authorization.) You will get id_token and access_token. The id_token value contains the information about the user's authentication.
I work on the team at Google: yes, unfortunately, this is a known deficiency and inconsistency of the iOS SDK for Google Sign-In. We're working on some changes and I'll update this answer when this is resolved.
For now, your backend server will have to determine what client the token is coming from and check appropriate audience. Very sorry for the trouble :/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With