# auth.oauth.approve

Completes the sign-in of a published MCP route with --auth oauth, in the app's own login pipeline, after the app has checked the person and signed its token (auth.token.create)

# auth.oauth.approve

```
auth.oauth.approve --ticket TEXT --token TEXT --client TEXT --redirect-host TEXT → oauth
```

Completes the sign-in of a published MCP route with `--auth oauth`, in the app's own login pipeline, after the app has checked the person and signed its token ([`auth.token.create`](/nodes/auth/auth.token.create.md)). The route sent the person to its `--login` page with `?oauth=<ticket>&client=<name>&redirect_host=<host>`; show both to the person, then pass them back: `--ticket`, `--client`, `--redirect-host`, and the app's token as `--token`. The ticket is used once and lives ten minutes; the shown client and host must be the ticket's; the token must verify with the route's `--credential`. Answers `oauth: { approved, client, redirect_host }` and, like [`web.response.send`](/nodes/web/web.response.send.md), answers the caller: a 303 back to the MCP client with a two-minute authorization code. A failure on a wired `:error` arrives as `oauth: { ok: false, error }` — render "this link has expired" there. Never reads or sets a Zebflow session.

## Flags

- `--ticket` (required): The ticket the route gave the login page — {{ input.webhook.query.oauth }}, or the form field the page posted it back in.
- `--token` (required): The app's token for the person who signed in — normally {{ input.token.access_token }}, signed with the route's --credential.
- `--client` (required): The client name the login page showed (its `client` query value): refused unless it is the ticket's.
- `--redirect-host` (required): The host the login page said the sign-in goes to (its `redirect_host` query value): refused unless it is the ticket's.

## Examples

### Approve after the app's login

```
| auth.oauth.approve --ticket "{{ input.webhook.body.oauth }}" --token "{{ input.token.access_token }}" --client "{{ input.webhook.body.client }}" --redirect-host "{{ input.webhook.body.redirect_host }}"
```

Before it: `trigger.webhook --route /auth/login --method POST | … check the password … | auth.token.create --credential library-jwt --claim "sub=…" --claim "roles={{ ['reader'] }}"`. The caller receives a 303 to the MCP client.

It answers:

```json
{
  "oauth": {
    "approved": true,
    "client": "Claude",
    "redirect_host": "claude.ai"
  }
}
```

## Used in

- [Sign in to a published MCP server (OAuth)](/examples/mcp-oauth-login.md)
