-
Notifications
You must be signed in to change notification settings - Fork 36
Google OAuth Setup
We are using Google OAuth to allow user to sign in into the application, and make adjustment to the records. If you are developing or contributing to this project, kindly follow the steps to configure your local OAuth.
You will need to register to Google Cloud, in order to create project.
https://console.cloud.google.com/
Click "Select a Project", and setup a new project.


It'll take some time to setup, so be patient.
Head over to this link to setup: https://console.cloud.google.com/apis/credentials/consent
Fill in the form as follows:
-
User Type:
External
-
App Information
-
App Name:
CariSurau-Dev
-
User Support Email:
<your email>
-
Developer contact information:
<your_email>
-
App Name:
- Scopes: Just Save and Continue, no change
-
Test users
- Click
Add Users
- Fill in your
<email>
- Click "Add" first time
- Click "Add" again for second time
- Click "Save and Continue"
- Click
- Finally, click "Back to Dashboard"
Head over to this link: https://console.cloud.google.com/apis/credentials
- Click
+ Create Credentials
, chooseOAuth Client ID
- Fill in the forms
-
Application Type:
Web Application
-
Name:
CariSurau-Dev
-
Authorized Javascript URL:
http://localhost:3000
-
Authorized redirect URL:
http://localhost:3000/api/auth/callback/google
-
Application Type:
- Finally, click "Create"
For more info about the callback URL, we are using NextAuth Google. More info: https://next-auth.js.org/providers/google
You should see a popup with credentials. Those are important secrets and never share with anyone. Do not commit into Git as well.
With that in mind, copy it accordingly into your ENVs.
/.env
GOOGLE_CLIENT_ID=<Client ID>
GOOGLE_CLIENT_SECRET=<Client secret>
To verify that everything works well, feel free to head over to the system and try to login.

Login using your account as usual.

Finally, you can now add records into the system and play around!
