Google OAuth
Prerequisites
- You have a Google Cloud Platform (GCP) account (opens in a new tab)
- You have completed the Setup guide
Setup
Create a Google Cloud Project
Go to the Google Cloud Console (opens in a new tab). Create a new project or select an existing one.
Create iOS Client ID
Go to APIs & Services > Credentials. Click Create Credentials and select OAuth client ID. Choose iOS as the application type. And add th Bundle ID of your app.
Enable Google Sign-In in the Supabase Dashboard
Go to your Supabase Dashboard (opens in a new tab), select your project, and open the Authentication section. Click on Providers and enable Google. In the popup, enter your iOS Client ID from the Google Cloud Console in the "Authorized Client IDs" Field. Also, enable Skip nonce check. Click Save to finish.
Make sure that the "Client ID (for OAuth)" and "Client Secret (for OAuth)" fields are empty otherwise you cannot save the changes.
Configure OAuth Consent Screen
In your Google Cloud project, navigate to APIs & Services > OAuth consent screen. Choose External user type and fill in the required information.
Get iOS URL Scheme & Client ID and add them to your config.js file
In your Google Cloud project, navigate to APIs & Services > Credentials. Click on the iOS OAuth Client you created. Copy the iOS URL Scheme.
Update the values in your config.js
file:
const config = {
...
googleOauth: {
iosClientId: '<some-id>.apps.googleusercontent.com',
iosUrlScheme: 'com.googleusercontent.apps.<some-id>',
...
},
}
Test Google Sign-In
That's it! You can now run your local development environment and test Google sign-in in your app.