How auth works
Three separate layers. Your agent never sees a manufacturer token, and a manufacturer never sees your agent.
On this page
① Agent OAuth
Reachthings is an OAuth 2.1 protected resource that follows the MCP authorization spec. Standard MCP SDKs handle this flow automatically.
- Agent calls
/mcpwithout a token →401withWWW-Authenticate: Bearer resource_metadata="…" - Agent reads
/.well-known/oauth-protected-resourceand discovers the authorization server. - User signs in and consents (Authorization Code + PKCE,
resourceparameter set to the MCP URL). - Agent retries with
Authorization: Bearer <token>.
| Scope | Allows |
|---|---|
| devices:read | list_devices, get_device, get_device_state, get_command_status, list_schedules, get_schedule, list_schedule_runs |
| devices:control | execute_device_action, cancel_command, create_schedule, update_schedule, cancel_schedule, pause_schedule, resume_schedule |
- devices:read
- Allowslist_devices, get_device, get_device_state, get_command_status, list_schedules, get_schedule, list_schedule_runs
- devices:control
- Allowsexecute_device_action, cancel_command, create_schedule, update_schedule, cancel_schedule, pause_schedule, resume_schedule
| Token claim | Meaning |
|---|---|
| sub | The end user. Decides whose devices are visible. |
| azp | Your OAuth client. Decides which grant applies. |
| aud | Must equal the MCP URL. Tokens for other audiences are rejected. |
- sub
- MeaningThe end user. Decides whose devices are visible.
- azp
- MeaningYour OAuth client. Decides which grant applies.
- aud
- MeaningMust equal the MCP URL. Tokens for other audiences are rejected.
② Manufacturer accounts
Users link brands in the dashboard with the manufacturer's own sign-in. Tokens are encrypted and refreshed before they expire. If a manufacturer revokes access, the connection shows reauth_required and pending commands are held, not dropped.
③ Agent grants
The first time a new client signs in for a user, Reachthings creates an empty grant. The user picks devices and actions, and can require approval per action. Revoking a grant returns 403 to that agent and rejects its pending commands with permission_revoked. Other agents are unaffected.
// Agent without access to a device
{ "command_id": null,
"error": { "code": "DEVICE_NOT_ACCESSIBLE",
"message": "The requested device was not found or is not accessible from this connection." } }