Skip to main content

Get credentials

1

Create a project

Go to Google Cloud Console and create a new project (or select an existing one).
2

Enable the People API

Navigate to APIs and Services > Library, search for “Google People API”, and enable it. This lets KavachOS fetch the user’s name and profile picture.
3

Create OAuth credentials

Go to APIs and Services > Credentials > Create Credentials > OAuth client ID.
  • Application type: Web application
  • Authorized redirect URIs: https://auth.example.com/auth/oauth/google/callback
Copy the Client ID and Client Secret.
4
Under OAuth consent screen, set the app name, support email, and authorized domain. For production, submit for verification if you need access to sensitive scopes.

Configuration

lib/kavach.ts
Add to your environment:

Scopes

Default scopes: openid email profile These give you name, email, and profile picture. To request additional permissions:
Extra scopes beyond openid email profile require your app to complete Google’s verification process before they work for users outside your organization.

User data returned

Initiating sign-in

Redirect users to:
Or add a query parameter to control the post-sign-in destination:
Last modified on April 29, 2026