https://supertokens.com/ logo
b

Biaz

07/07/2022, 5:19 PM
Hello again :D. We have a problem with the Google Login using Capacitor. We don't know how to set "supertokens-node side" for the iOS and Android User Agents. We don't found it on docs. Can some help us?
r

rp

07/07/2022, 5:20 PM
Hey!
b

Biaz

07/07/2022, 5:20 PM
Hi again!
r

rp

07/07/2022, 5:20 PM
I don’t think I understand your question
Can you please elaborate?
b

Biaz

07/07/2022, 5:24 PM
We are build an Ionic and Angular App with Capacitor. We use this plugin https://github.com/CodetrixStudio/CapacitorGoogleAuth for the native side of auth for to get the AuthServerCode and pass it to the server for auth
ThirdPartyEmailPassword.Google({ clientId: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', scope: ['profile', 'email'], }), We set on Node.js side this in the init. But it works only for web. For iOS and Android on Cloud Platforms we don't have any clientSecret and different CLIENT_IDS
We need to authenticate the code from the library on Node.js
On the same project on Google Cloud for iOS we and Android we have a different clientID and no secrets for iOS, but clientSecret is mandatory in Supertokens Node
r

rp

07/07/2022, 6:14 PM
Right I see. So for this, you would not get the code from google, but the actual JSON object contains the the access token etc on the mobile app
It does exactly what you are looking for
We don’t have a capacitor example yet unfortunately. So this example is the closest to your needs
Essentially, you can configure multiple google providers on the backend and can make them use different client ids
If you see the server/index.js file, we do a google.init with an empty clientID and secret.
You call the signInUp API without the code, but instead you pass it the actual JSON object which you get from google