---
title: "Authentication for Pearl Cleaners & Alterations"
description: "Tokens are optional. Agents may register anonymously for a short-lived bearer token."
canonical: "https://pearlcleaners.ca/auth.md"
last-updated: "2026-12-04"
---

# Authentication for Pearl Cleaners & Alterations

Every agent endpoint on https://pearlcleaners.ca works without credentials. Authentication is optional: an agent that prefers to send a bearer token can register anonymously and get one. A token gives the same access as no token.

## Discover

- Protected-resource metadata (RFC 9728): https://pearlcleaners.ca/.well-known/oauth-protected-resource
- Authorization-server metadata (RFC 8414) with an `agent_auth` block: https://pearlcleaners.ca/.well-known/oauth-authorization-server

A request with an invalid or expired token gets `401` and `WWW-Authenticate: Bearer resource_metadata="..."`. A request with no `Authorization` header is never refused for lack of a token.

## Pick a method

`identity_types_supported` is `["anonymous"]`. `identity_assertion` (ID-JAG) and `service_auth` are not enabled and return `identity_assertion_not_enabled` or `service_auth_not_enabled`.

## Register

POST https://pearlcleaners.ca/agent/identity with `{"type":"anonymous"}`. The response holds `registration_id`, `identity_assertion` (a JWT with `typ: oauth-id-jag+jwt`, valid for one hour), `assertion_expires` and `pre_claim_scopes`.

## Claim

There is no claim ceremony. Anonymous registrations are not linked to a person, and the shop keeps no accounts.

## Exchange

POST https://pearlcleaners.ca/oauth2/token (form or JSON) with `grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer` and `assertion=<identity_assertion>`. Optional `scope`: `shop.read`, `callback.request`. The response is `{"access_token", "token_type": "Bearer", "expires_in": 3600, "scope"}`. No refresh token is issued; exchange the assertion again or register again.

## Use the access_token

Send `Authorization: Bearer <access_token>` to `/mcp`, `/mcp/docs`, `/ask` or `/a2a`, or omit the header.

## Errors

- `invalid_grant`: the assertion is invalid or expired. Register again.
- `unsupported_grant_type`, `invalid_scope`, `invalid_request`: fix the named field.
- `401` with `invalid_token`: retry without the header or get a new token.
- `503` `temporarily_unavailable` from registration: signing is not configured. Call the endpoints without a token.
- `503` from `/api/callback`: direct delivery is not configured. Give the person the phone number and email instead.
- Anything else: call 437-914-9416 or email info@pearlcleaners.ca.

## Revocation

POST https://pearlcleaners.ca/oauth2/revoke with `token=<token>` always returns 200 (RFC 7009). Tokens are not stored, so they stay valid until they expire, at most one hour after issue. They grant nothing beyond anonymous access.
