OAuth clients & resource servers
- Written for
- + Written for
- Deprecated
- + Deprecated
- Applies to
- + Applies to
OAuth clients & resource servers
Atlas can be an OAuth/OpenID provider — "Sign in with Atlas". You register the third-party (or first-party) apps that authenticate against your instance as OAuth clients, and the machine-to-machine APIs they call as resource servers. The protocol endpoints those clients hit are documented under OpenID Connect & OAuth2.
OAuth clients
{
"object": "oauth_client",
"id": "oac_…",
"client_id": "atlas_client_…",
"name": "Acme Web",
"redirect_uris": ["https://acme.com/callback"],
"allowed_scopes": ["openid", "profile", "email"],
"grant_types": ["authorization_code", "refresh_token"],
"token_endpoint_auth_method": "client_secret_basic",
"is_public": false,
"first_party": true,
"created_at": 1757000000000,
"updated_at": 1757600000000
}Method & path | Scope | Notes |
|---|---|---|
|
| Secret never returned |
|
| Register a confidential or public (PKCE) client. A confidential client's secret is revealed once. idempotent |
|
| Never the secret |
|
| Update name/redirect_uris/scopes (secret immutable here). idempotent |
|
| Rotate; new secret revealed once. idempotent |
|
| Delete; codes + grants cascade. idempotent |
Client → resource-server grants (client credentials)
Method & path | Scope |
|---|---|
|
|
|
|
|
|
Resource servers (M2M APIs)
An API you protect with Atlas-issued access tokens: an audience identifier, its scopes, and a token TTL.
Method & path | Scope | Notes |
|---|---|---|
|
| List APIs + scopes |
|
| Register (audience, scopes, TTL) |
|
| |
|
| Identifier (audience) is immutable |
|
| Client grants cascade |
Example
// Register a confidential client — capture the one-time secret
const client = await atlas.oauthClients.create({
name: 'Acme Web',
redirect_uris: ['https://acme.com/callback'],
allowed_scopes: ['openid', 'profile', 'email'],
});
console.log(client.client_id, client.client_secret); // secret shown once
// Register an API and authorize the client for it (client_credentials)
const api = await atlas.resourceServers.create({ /* identifier, scopes, ttl */ } as any);
await atlas.oauthClients.grants.create(client.id, { resource_server_id: api.id, scopes: ['reports:read'] });Clients then run the standard flows at /oauth2/authorize and /oauth2/token; verify access tokens at /oauth2/introspect or against the JWKS. See OpenID Connect & OAuth2.