Integeri

Integeri Documentation

OAuth — user login

Authorization code with PKCE for https://next.integeri.com/api/v1. This page: https://next.integeri.com/docs/api/v1/oauth/en — Deutsch / English

Purpose

Employees of a company sign in with their integeri account. The other application does not store a separate password. It receives a short-lived token with the profile.read scope.

The rest of the HTTP API (locations, teams, users, courses) stays on client credentials. That is described in the API documentation.

Two client kinds

  • Machine client: grant client_credentials, scope *, access token 30 days. The token acts as the company's service user.
  • User client: grants authorization_code and refresh_token, scope profile.read only. Access token 60 minutes, refresh token 14 days. No service user. client_credentials is not allowed for this client.

Each company has one user client. The redirect URI is exactly https://<their-domain>/auth/callback (several URIs are allowed; each must match in full).

Flow

  1. The other application creates a code_verifier and a SHA-256 code_challenge (S256).
  2. The browser opens GET https://next.integeri.com/oauth/authorize.
  3. Without a session the /login page is used, including two-factor. There is no extra consent screen.
  4. integeri checks: active user, same company as the client, scope exactly profile.read, PKCE method S256.
  5. The browser returns to the redirect URI with code and the supplied state.
  6. The other application's server exchanges the code at POST https://next.integeri.com/oauth/token.

Authorize

GET https://next.integeri.com/oauth/authorize?response_type=code
  &client_id=<UUID>
  &redirect_uri=https://<their-domain>/auth/callback
  &scope=profile.read
  &state=<random value>
  &code_challenge=<S256>
  &code_challenge_method=S256

code_challenge is required, and code_challenge_method must be S256. state is returned unchanged and should be checked by the other application.

Token exchange

POST https://next.integeri.com/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code
&client_id=<UUID>
&client_secret=<secret>
&redirect_uri=https://<their-domain>/auth/callback
&code=<code>
&code_verifier=<verifier>

The response contains access_token, refresh_token, token_type (Bearer), and expires_in (about 3600). The code is single-use and short-lived.

The password grant and the implicit grant are not enabled. A machine client cannot use this grant, and a user client cannot use client_credentials.

Refresh

POST https://next.integeri.com/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=refresh_token
&refresh_token=<refresh token>
&client_id=<UUID>
&client_secret=<secret>

The previous refresh token is revoked when it is used. The response contains a new pair. Access tokens issued this way last 60 minutes again, and the scope stays profile.read.

Profile and logout

GET https://next.integeri.com/api/v1/auth/me
Authorization: Bearer <access_token>

The response is the signed-in employee, not the service user:

  • id, email, state, company_id
  • roles — role names
  • team_ids — the user's teams
POST https://next.integeri.com/api/v1/auth/logout
Authorization: Bearer <access_token>

Logout revokes the access token and the refresh token that belongs to it.

Limits

  • User tokens may call only GET /api/v1/auth/me and POST /api/v1/auth/logout. Every other route returns 403.
  • The user must be active and belong to the client's company.
  • The redirect URI must be one of the registered URIs.
  • PKCE with S256 is required for this confidential client as well.