How to get your google client id and client secret

1. Go to Google Cloud Console

https://console.cloud.google.com

2. At the top-left, click the project dropdown. Either create a new project (e.g., “Spring Boot OAuth2 Demp App”) or select an existing one.

3. In the left menu, go to APIs & Services → OAuth consent screen.

4. Choose External (if anyone with a Google account can log in) or Internal (only users in your org).

5. Fill in app details (App name, User support email, Developer contact email). Save and continue

6. Create OAuth 2.0 Client ID

– In the left menu, go to APIs & Services → Credentials.
– Click + Create Credentials → OAuth client ID.
– Select Application type = Web application.
– Enter a name (e.g., “Spring Boot App”).
– Under Authorized redirect URIs, add:
– http://localhost:8080/login/oauth2/code/google
-(Spring Security’s default redirect for Google login)
– Click Create.

7. Google will now show you a Client ID and Client Secret. Copy and use it.