Skip to content

The v1 docs follow nauthera-server's main branch and its 0.x releases on the way to 1.0, so fields and APIs can still change.

v1

API Reference

Docs version v1 (main)Nauthera is pre-1.0, in a design-partner program

OAuth 2.0 and OpenID Connect endpoints served on the public listener.

v1.0.0OpenAPI documentSourceGenerated from main

The public HTTP API of nauthera-server. Nauthera is a self-hosted OAuth 2.0 and OpenID Connect identity provider for Kubernetes, written in Go.

The API serves OpenID Connect Discovery 1.0 and RFC 8414 authorization server metadata, the JSON Web Key Set, the authorization endpoint (authorization code with PKCE), pushed authorization requests (RFC 9126), the token endpoint (authorization code, refresh token, client credentials and device code grants), device authorization (RFC 8628), token introspection and revocation, UserInfo, RP-initiated logout, dynamic client registration and management (RFC 7591, RFC 7592), the endpoints behind the hosted sign-in pages, and the admin API under /v1/admin.

Tokens can be sender-constrained with DPoP (RFC 9449), and authorization responses identify their issuer (RFC 9207), as the OAuth 2.0 Security Best Current Practice (RFC 9700) recommends. Which specifications are implemented, in full or in part, is listed at https://www.nauthera.io/standards.

This reference is generated from the OpenAPI document that nauthera-server is built from, so it describes exactly what the server accepts and returns. Every endpoint page shows a ready-to-run request in cURL, JavaScript, Python and Go, with an example response for each status.

Base URL

Paths are relative to your organization's issuer URL: the server root for the main organization, /orgs/{slug} for every other one (see Organizations). The examples use:

https://auth.example.com
  • https://auth.example.com — Production issuer (replace with your issuer.url)
  • http://localhost:8080 — Local development (just run)

Authentication

Bearer tokenbearerAuthJWT

A bearer (or DPoP) access token issued by this provider.

HTTP BasicclientSecretBasic

Confidential-client credentials via HTTP Basic (client_secret_basic).

Registration access tokenregistrationAccessToken

The RFC 7592 registration access token for client management.

Initial access tokeninitialAccessToken

The RFC 7591 §1.2 initial access token: an OAuth 2.0 access token carrying the nauthera.clients:register scope, which authorizes calls to the client registration endpoint and supplies the organization the new client is bound to. RFC 7591 §3 makes open (unauthenticated) registration a SHOULD; this deployment deviates deliberately, because every client here belongs to an org and an anonymous registrant has none.

OAuth 2.0oauth2

OAuth 2.0 access tokens used to authorize the admin REST surface (/v1/admin/**). Two flows are advertised, both minting tokens against this provider's /token endpoint:

  • authorizationCode (PKCE, RFC 7636) — an interactive operator signs in to their organization's admin-console client (a public PKCE client auto-provisioned per org) and receives an access token carrying the granted OAuth scopes (below). The caller's roles are read from user_org_roles on every request, not taken from the token.
  • clientCredentials (RFC 6749 §4.4) — a confidential machine-to-machine admin client exchanges its client_id/client_secret for an access token carrying the scopes its registration grants (and any admin roles bound to it through reserved client labels). Used for headless automation of the admin surface.

Authorization on every admin operation is the CONJUNCTION of two independent checks: the token's scope claim MUST contain the operation's declared scope (validated via oauthsrv.HasScope) AND the caller MUST hold the permission the operation declares in its x-permission, resolved from their roles through a fixed table (internal/rbac). A token that carries the scope but whose caller lacks the permission — or the reverse — is rejected. A scope caps what a client may do on its user's behalf; a permission is what that user may do at all. x-permissions below is the closed permission vocabulary, and the server's handlers are held to each operation's declaration by a test. The users and audit scopes below are org-scoped: a caller acts only within its own org unless a platform role held in the main org admits it to every org. The clients, sessions, insights, threats and roles scopes are the admin dashboard's, registered by every organization's admin console alone; like every scope they cap what a client may ask for, and the permission each operation declares does the fine-grained work.

x-permission also declares whether the operation requires a recent sign-in. A token whose sign-in is older than the deployment allows (fifteen minutes by default), states none, or lacks a second factor the deployment requires is answered 401 insufficient_user_authentication, with an RFC 9470 challenge carrying max_age (and acr_values): sign in again and replay the call.

Authorization code flow18 scopes

Authorization URL https://auth.example.com/authorize

Token URL https://auth.example.com/token

Refresh URL https://auth.example.com/token

  • openid

    OpenID Connect authentication (issue an ID token).

  • profile

    Basic profile claims (name, preferred_username, …).

  • email

    Email-address claims (email, email_verified).

  • offline_access

    Issue a refresh token for long-lived access.

  • nauthera.orgs:read

    Read organizations through the admin API (list and get). Pairs with the orgs.read permission: held in an organization, it reads that organization; listing them, and reading any other, takes a platform role held in the main org.

  • nauthera.orgs:write

    Create, update and delete organizations through the admin API. Pairs with the orgs.write permission, which only a platform role held in the main org grants.

  • nauthera.users:read

    Read local users through the admin API (list and get). Pairs with the users.read permission; confined to the caller's own org unless a platform role held in the main org admits it to every org.

  • nauthera.users:write

    Create, update, delete, suspend, block, reactivate and unlock local users, set their passwords and email them reset links through the admin API. Pairs with the users.create, users.update, users.delete, users.lifecycle or users.credentials permission, whichever the operation declares; confined to the caller's own org unless a platform role held in the main org admits it to every org.

  • nauthera.audit:read

    Read the audit log through the admin API. Pairs with the audit.read permission; confined to the caller's own org unless a platform role held in the main org admits it to every org. Platform-scoped records are visible only to a caller who also holds platform.audit.

  • nauthera.clients:read

    Read an organization's OIDC clients through the admin API. Pairs with the clients.read permission. Distinct from nauthera.clients:register, which authorizes dynamic client registration and grants no admin authority.

  • nauthera.sessions:read

    Read users' sessions through the admin API. Pairs with the sessions.read permission.

  • nauthera.sessions:write

    End users' sessions through the admin API. Pairs with the sessions.revoke permission.

  • nauthera.insights:read

    Read an organization's insights and alerts through the admin API. Pairs with the insights.read permission.

  • nauthera.threats:read

    Read an organization's threat analytics through the admin API. Pairs with the threats.read permission.

  • nauthera.roles:read

    Read who holds which role through the admin API. Pairs with the roles.read permission.

  • nauthera.roles:write

    Grant and revoke roles through the admin API. Pairs with the roles.assign permission.

  • nauthera.brokers:write

    Invite, accept, limit and end broker memberships through the admin API. Pairs with the brokers.manage permission.

  • nauthera.domains:write

    Claim, verify and remove email domains through the admin API. Pairs with the domains.manage permission.

Client credentials flow14 scopes

Token URL https://auth.example.com/token

Refresh URL https://auth.example.com/token

  • nauthera.orgs:read

    Read organizations through the admin API (list and get). Pairs with the orgs.read permission: held in an organization, it reads that organization; listing them, and reading any other, takes a platform role held in the main org.

  • nauthera.orgs:write

    Create, update and delete organizations through the admin API. Pairs with the orgs.write permission, which only a platform role held in the main org grants.

  • nauthera.users:read

    Read local users through the admin API (list and get). Pairs with the users.read permission; confined to the caller's own org unless a platform role held in the main org admits it to every org.

  • nauthera.users:write

    Create, update, delete, suspend, block, reactivate and unlock local users, set their passwords and email them reset links through the admin API. Pairs with the users.create, users.update, users.delete, users.lifecycle or users.credentials permission, whichever the operation declares; confined to the caller's own org unless a platform role held in the main org admits it to every org.

  • nauthera.audit:read

    Read the audit log through the admin API. Pairs with the audit.read permission; confined to the caller's own org unless a platform role held in the main org admits it to every org. Platform-scoped records are visible only to a caller who also holds platform.audit.

  • nauthera.clients:read

    Read an organization's OIDC clients through the admin API. Pairs with the clients.read permission. Distinct from nauthera.clients:register, which authorizes dynamic client registration and grants no admin authority.

  • nauthera.sessions:read

    Read users' sessions through the admin API. Pairs with the sessions.read permission.

  • nauthera.sessions:write

    End users' sessions through the admin API. Pairs with the sessions.revoke permission.

  • nauthera.insights:read

    Read an organization's insights and alerts through the admin API. Pairs with the insights.read permission.

  • nauthera.threats:read

    Read an organization's threat analytics through the admin API. Pairs with the threats.read permission.

  • nauthera.roles:read

    Read who holds which role through the admin API. Pairs with the roles.read permission.

  • nauthera.roles:write

    Grant and revoke roles through the admin API. Pairs with the roles.assign permission.

  • nauthera.brokers:write

    Invite, accept, limit and end broker memberships through the admin API. Pairs with the brokers.manage permission.

  • nauthera.domains:write

    Claim, verify and remove email domains through the admin API. Pairs with the domains.manage permission.

Permissions21
  • orgs.read

    Read organizations.

  • orgs.write

    Create, update and delete organizations.

  • users.read

    Read an organization's users.

  • users.pii.read

    Read users' personal data, such as email addresses and attributes.

  • users.create

    Create users.

  • users.update

    Change a user's email address, username and attributes.

  • users.delete

    Delete users.

  • users.lifecycle

    Suspend, block, reactivate and unlock users.

  • users.credentials

    Set a user's password and manage their second factors.

  • users.activity

    Read what a user did and what was done to them.

  • sessions.read

    Read users' sessions.

  • sessions.revoke

    End users' sessions.

  • clients.read

    Read an organization's OIDC clients.

  • audit.read

    Read an organization's audit log.

  • platform.audit

    Read the platform-scoped audit records, which concern the deployment rather than any one organization, beside an organization's own.

  • insights.read

    Read an organization's insights and alerts.

  • threats.read

    Read an organization's threat analytics: the attack signals counted from its audit log, against their recommended thresholds.

  • roles.read

    Read who holds which role.

  • roles.assign

    Grant and revoke roles.

  • brokers.manage

    Invite, accept, limit and end broker memberships, which let one organization's clients sign in another's users.

  • domains.manage

    Claim, verify and remove the email domains that route a sign-in to an organization.

Endpoints

Discovery

OpenID Connect discovery, AS metadata, and key material.

OAuth2

OAuth2 protocol endpoints (RFC 6749, 7009, 7662, 8628, 9126).

OpenID Connect

OpenID Connect protocol endpoints (OIDC Core, RP-Initiated Logout).

Client Registration

Dynamic client registration and management (RFC 7591, 7592).

Interactive

Browser-facing endpoints backing the hosted auth UI (/ui): password sign-in, local registration, and sign-out. Same-origin JSON; not part of the OAuth2/OIDC wire protocol.

Admin

Privileged administrative endpoints for managing organizations (orgs) and their local users (CRUD), versioned under /v1/admin. Authenticated by a Bearer access token: every operation enforces its declared nauthera.* scope (via the oauth2 security scheme) IN ADDITION to the permission it declares in x-permission, which the caller's roles must grant. Organization endpoints are main-org only; user and audit endpoints are confined to the caller's own org unless a platform role held in the main org admits them to every org. All list endpoints use opaque cursor (keyset) pagination — bound the page with limit, order it with sort (per-endpoint x-sort-fields), then pass the previous response's page.next_cursor back as cursor for as long as page.has_more is true. Not part of the OAuth2/OIDC wire protocol.

About this API