Before you can use Sign in with Google, you need to obtain a Google Cloud Platform account and have a project ready or create a new one. Please follow this guide to obtain the client ID and client secret.
For example, I create a project that used for localhost development. After creating a new project, you can add the OAuth 2.0 client ID by going to APIs & Services
-> Credentials
-> Create Credentials
-> OAuth client ID
.
Under 'Application type*', select 'Web application'.
The redirect URI should be <your host server public ip/hostname>/gotrue/callback
. For example, my host server is localhost
, so the redirect URI is http://localhost/gotrue/callback
.
Copy the Client ID and Client Secret to the .env
file.
Begin by accessing your GitHub Developer Settings:
- Click on your profile photo at the top right corner.
- Select 'Settings' from the dropdown menu.
- Scroll down and select 'Developer settings' from the left sidebar.
- Click 'OAuth Apps' in the same sidebar.
- In the 'OAuth Apps' section, click 'New OAuth App'.
- Fill in the 'Application name' with your app's name.
- For 'Homepage URL', provide the full URL to your app's homepage.
- Specify your app's 'Authorization callback URL' where users will be redirected post-authorization. The redirect URI should be
<your host server public ip/hostname>/gotrue/callback
. For example, my host server islocalhost
, so the redirect URI ishttp://localhost/gotrue/callback
.. - Click 'Register Application' at the bottom.
- Once registered, securely store the generated OAuth credentials.
- Copy and save your Client ID.
- Click Generate a new client secret.
Update the .env
file with the Client ID and Client Secret.
- Visit Discord.
- Click 'Login' in the top right corner to access your account.
- Once logged in, navigate to the Discord Developer Portal.
- Click 'New Application' in the top right.
- Name your application and select 'Create'.
- In the settings menu, choose 'OAuth2'.
- Under 'Redirects', select 'Add Redirect' and input your callback URL. The redirect URI should be
<your host server public ip/hostname>/gotrue/callback
. For example, my host server islocalhost
, so the redirect URI ishttp://localhost/gotrue/callback
. - Remember to 'Save Changes' at the bottom.
- Under 'Client Information', note down your 'Client ID' and 'Client Secret' for later use.
Update the .env
file with the Client ID and Client Secret.