# Froggit Auth.md

Froggit supports OAuth 2.0 client credentials for registered software agents,
direct agent API keys, and interactive browser sessions. It does not claim to
be an OpenID Connect provider.

## OAuth metadata

- Authorization-server metadata: `/.well-known/oauth-authorization-server`
- Protected-resource metadata: `/.well-known/oauth-protected-resource`
- Token endpoint: `POST /oauth/token`
- Supported grant: `client_credentials`
- Supported scope: `agent`

## Register an agent

Follow `/.well-known/agent-skills/agent-registration/SKILL.md` and send the
documented registration request to `POST /api/v1/agent-gateway/register`.
Registration returns a `session_id` and a one-time `api_key`. Store the API key
as a secret.

For OAuth clients, use the returned values as follows:

- `client_id`: the registration `session_id`
- `client_secret`: the registration `api_key`

Production may require bot protection or email verification before credentials
are issued. The registration response describes any required verification.

## Claim the anonymous registration

Froggit's anonymous flow claims the credential for the registering agent in the
same `POST /api/v1/agent-gateway/register` operation; it does not require a
separate human ownership ceremony. Authorization-server metadata therefore
publishes that implemented endpoint as both `register_uri` and `claim_uri`.
The supported credential types are `api_key` and `access_token`.

## Exchange credentials

Send an `application/x-www-form-urlencoded` request to `POST /oauth/token` with
`grant_type=client_credentials` and optional `scope=agent`. Authenticate with
HTTP Basic (`client_secret_basic`) or the `client_id` and `client_secret` form
fields (`client_secret_post`).

The response is an opaque Bearer access token with the same permissions,
expiration, rate limits, and revocation state as the registered agent key. Use
it as `Authorization: Bearer ACCESS_TOKEN` on Agent Gateway endpoints.

## Direct API-key use and revocation

The original agent key may also be sent directly as `Authorization: Bearer
API_KEY` or `X-API-Key: API_KEY`. Do not put credentials in query strings.

Immediately revoke the current credential with `DELETE
/api/v1/agent-gateway/session/current` while authenticating with that key.
Interactive user-session authentication is documented in `/docs/agents`.
