> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kavachos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Yahoo

> Authenticate users with Yahoo via `yahooProvider`. Covers Developer Console app creation, OpenID Connect API enablement, and email and profile scopes.

## Get credentials

<Steps>
  <Step>
    ### Create an app

    Go to the [Yahoo Developer Console](https://developer.yahoo.com/apps/) 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.
  </Step>

  <Step>
    ### Copy your credentials

    After creating the app, copy the **Client ID (Consumer Key)** and **Client Secret (Consumer Secret)**.
  </Step>
</Steps>

## Configuration

```typescript title="lib/kavach.ts" theme={"system"}
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!,
        ),
      ],
    }),
  ],
});
```

```bash theme={"system"}
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              |

<Info>
  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.
</Info>

## Endpoints

| Method | Path                          | Description       |
| ------ | ----------------------------- | ----------------- |
| GET    | `/auth/oauth/authorize/yahoo` | Redirect to Yahoo |
| GET    | `/auth/oauth/callback/yahoo`  | Handle callback   |
