Authentication
Yahoo
Sign in with Yahoo using OAuth 2.0.
Get credentials
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/yahooEnable the OpenID Connect API and the Email scope.
Copy your credentials
After creating the app, copy the Client ID (Consumer Key) and Client Secret (Consumer Secret).
Configuration
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
| Scope | What it unlocks |
|---|---|
openid | OIDC authentication |
profile | Display name and profile details |
email | Yahoo 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
| Method | Path | Description |
|---|---|---|
| GET | /auth/oauth/authorize/yahoo | Redirect to Yahoo |
| GET | /auth/oauth/callback/yahoo | Handle callback |