After creating the Google OAuth2 Project and enabling the required APIs during the environment preparation step, you need to create an OAuth2 Client ID and Client Secret to integrate Google Sign-In into your e-commerce system.
Steps to follow:
Access Google Cloud Console
Create OAuth2 Client ID
Navigate to APIs & Services → Credentials.
Click + Create Credentials → OAuth client ID.
Click Configure consent screen.
Click Get Started.
Fill in the following information:
App name: FcjFashionShop
User support email: Enter your email
Click Next
Email addresses: Enter your email
Click Next
Check I agree to the Google API Services: User Data Policy.
Click Continue and then Create
In Metrics, click Create OAuth client
For Application type, select Web application
Name: FcjFashionShop
In Authorized JavaScript origins
In Authorized redirect URIs
your-API-Gateway-domain/api/users/auth/google/callback
Authorized JavaScript origins: this is your frontend domain (the S3 Static Website endpoint).
Authorized redirect URIs: this is the backend endpoint (API Gateway) that handles the Google callback.
Security note:
Never publish your Client Secret on Github or anywhere public!
Conclusion:
After completing these steps, you have all the necessary information to configure Google OAuth2 for both backend and frontend, and are ready to implement Google Sign-In for your e-commerce website project on AWS.