Skip to main content

Get credentials

1

Create an app

Go to the Yahoo Developer Console and create a new app. Select Web Application as the application type.Set the Callback Domain and add your redirect URI:
https://your-app.com/api/kavach/auth/oauth/callback/yahoo
Enable the OpenID Connect API and the Email scope.
2

Copy your credentials

After creating the app, copy the Client ID (Consumer Key) and Client Secret (Consumer Secret).

Configuration

lib/kavach.ts
import { createKavach } from 'kavachos';
import { oauth, yahooProvider } from 'kavachos/auth';

const kavach = await createKavach({
  database: { provider: 'postgres', url: process.env.DATABASE_URL! },
  secret: process.env.KAVACH_SECRET!,
  baseUrl: 'https://your-app.com',
  plugins: [
    oauth({
      providers: [
        yahooProvider(
          process.env.YAHOO_CLIENT_ID!,
          process.env.YAHOO_CLIENT_SECRET!,
        ),
      ],
    }),
  ],
});
YAHOO_CLIENT_ID=...
YAHOO_CLIENT_SECRET=...

Scopes

Default scopes: openid, profile, email
ScopeWhat it unlocks
openidOIDC authentication
profileDisplay name and profile details
emailYahoo email address
Yahoo requires the OpenID Connect API to be explicitly enabled in your app’s API permissions. Without it, the token endpoint will return an error even if openid is in the scope.

Endpoints

MethodPathDescription
GET/auth/oauth/authorize/yahooRedirect to Yahoo
GET/auth/oauth/callback/yahooHandle callback
Last modified on April 17, 2026