Documentation

Plain OIDC quick start

Use any standard OpenID Connect library: the endpoints, the flow and the token checks.

All documentation

Before you start

  • Create a workspace at https://auth.ziqme.com/signup. It starts on the Free plan; no card is needed.
  • Open https://app.ziqme.com/auth-admin, choose "Register application", and add your redirect URI. A browser or mobile app is a public application (no secret). A server is confidential and gets a client secret, shown once.
  • Note the client ID (it starts with app_). It is safe to ship in a browser: it is not a secret.

Endpoints

PurposeURL
Discoveryhttps://auth.ziqme.com/.well-known/openid-configuration
Public keys (JWKS)https://auth.ziqme.com/jwks
Authorizationhttps://auth.ziqme.com/authorize
Tokenhttps://auth.ziqme.com/token
UserInfohttps://auth.ziqme.com/userinfo
Logouthttps://auth.ziqme.com/end-session
Revocationhttps://auth.ziqme.com/revoke
Introspectionhttps://auth.ziqme.com/introspect

The flow

  • Create a PKCE verifier and its S256 challenge. PKCE is required for every client, confidential ones included.
  • Send the browser to /authorize with response_type=code, client_id, redirect_uri, scope (it must include openid), state, nonce, code_challenge and code_challenge_method=S256.
  • Auth shows its hosted login, or skips it when the browser already has a session for a person of your workspace.
  • Auth redirects to redirect_uri with code, state and iss. Check that state is yours and that iss equals the issuer.
  • Exchange the code at /token with grant_type=authorization_code, code, redirect_uri and code_verifier. A confidential client authenticates with HTTP Basic; a public client sends only client_id. Codes last 2 minutes and work once.
Token request
curl -X POST https://auth.ziqme.com/token \
  -d grant_type=authorization_code \
  -d client_id=app_your_client_id \
  -d code=THE_CODE \
  -d redirect_uri=https://app.example/callback \
  -d code_verifier=THE_VERIFIER

Scopes

ScopeEffect
openidRequired. Issues an ID token
profilename, given_name, family_name
emailemail
rolesroles: the person's roles in this application
offline_accessA refresh token in the token response

Verify tokens

Validate the RS256 signature against the JWKS, the issuer, your own client ID as the audience, and the lifetime. Access tokens have the JWT type at+jwt and last 15 minutes by default. Do not accept a token whose audience is another client.

Node, with jose
import { createRemoteJWKSet, jwtVerify } from 'jose'

const issuer = 'https://auth.ziqme.com'
const jwks = createRemoteJWKSet(new URL(`${issuer}/jwks`))

const { payload } = await jwtVerify(accessToken, jwks, {
  issuer,
  audience: 'app_your_client_id',
  typ: 'at+jwt',
})

Signing keys rotate on their own: a new key is published 24 hours before it signs. Cache the JWKS, and fetch it again when you meet an unknown key ID.

Workspace issuers are being rolled out. Once yours is on, your workspace also has an issuer of its own, https://auth.ziqme.com/w/your-workspace-id, with its own signing keys: its tokens name it as iss and verify only against its JWKS, so a token from another workspace never passes. The admin app shows it on each application. To move, set it as your issuer and accept the shared issuer as well for 15 minutes; client ID, secret and redirect URIs stay the same. The shared issuer keeps working meanwhile.