Skip to content

Latest commit

 

History

History
82 lines (57 loc) · 3.88 KB

AUTHENTICATION.md

File metadata and controls

82 lines (57 loc) · 3.88 KB

Authentication

Table of Contents

Google

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.

create_credentials.png

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.

create_client.png

client_id_and_secret.png

Copy the Client ID and Client Secret to the .env file.

env.png

Github

Setting up OAuth Application on GitHub

Begin by accessing your GitHub Developer Settings:

  1. Click on your profile photo at the top right corner.
  2. Select 'Settings' from the dropdown menu.
  3. Scroll down and select 'Developer settings' from the left sidebar.
  4. Click 'OAuth Apps' in the same sidebar.

Registering Your OAuth Application

  1. In the 'OAuth Apps' section, click 'New OAuth App'.
  2. Fill in the 'Application name' with your app's name.
  3. For 'Homepage URL', provide the full URL to your app's homepage.
  4. 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 is localhost, so the redirect URI is http://localhost/gotrue/callback..
  5. Click 'Register Application' at the bottom.
  6. Once registered, securely store the generated OAuth credentials.
  7. Copy and save your Client ID.
  8. Click Generate a new client secret.

Update the .env file with the Client ID and Client Secret.

Discord

  1. Visit Discord.
  2. Click 'Login' in the top right corner to access your account.

Create a New Application

  1. Once logged in, navigate to the Discord Developer Portal.
  2. Click 'New Application' in the top right.
  3. Name your application and select 'Create'.
  4. In the settings menu, choose 'OAuth2'.
  5. 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 is localhost, so the redirect URI is http://localhost/gotrue/callback.
  6. Remember to 'Save Changes' at the bottom.
  7. 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.