Integrating Google Sign-In can streamline the login process by allowing users to authenticate using their Google account. This guide will help you create a Google Client ID and Client Secret for your crypto exchange platform.
Pre-requisites:
- A Google account is required to access the Google Developers Console.
-
Access Google Developers Console
- Navigate to the Google Developers Console.
-
Create a New Project
- Click on "Select a project" at the top of the screen, then choose "New Project." Complete the form and click "Create."
-
Configure OAuth Consent Screen
- Select Api & Services > "OAuth consent screen" from the sidebar. Choose your User Type (usually 'External' for crypto exchanges) and click "Create."
-
Enter Application Information
- Provide the following details:
- Application name
- Support email
- Authorized domain (e.g.,
yoursite.com
) - Developer contact information
- Click "Save and Continue."
- Provide the following details:
-
Complete OAuth Consent Steps
- Complete the required steps indicated on the OAuth consent screen, then click "Back to Dashboard."
-
Create Credentials
- Navigate to the "Credentials" tab, click "Create Credentials," and select "OAuth client ID."
-
Register Application Type
- Choose "Web application" as the "Application type." Provide a name for your OAuth 2.0 client.
-
Set Authorized URIs
- Under "Authorized JavaScript origins," add your site URL.
- For "Authorized redirect URIs," enter the URL where users will be redirected after authentication (e.g.,
https://yoursite.com/Login/googleRedirect
). - Click "Create."
Important:
- Authorized JavaScript Origins:
https://yoursite.com
- Authorized Redirect URL:
https://yoursite.com/Login/googleRedirect
-
Retrieve Client ID and Secret
- Copy the Client ID and Client Secret from the confirmation screen.[ Or even save JSON file for future reference]
-
Update Your Configuration
- In your site's configuration file (e.g.,
other_config.php
), setGOOGLE_LOGIN_ALLOWED
to1
. - Add your
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
to the respective fields.
- In your site's configuration file (e.g.,
With the Client ID and Client Secret, you can now integrate Google Sign-In into your site's authentication system. Ensure to follow security best practices when handling and storing these credentials.