Skip to main content
MobKit authenticates console access and API requests using JWT tokens validated against OIDC providers. The auth system supports multiple identity providers with email-based access control.

Auth providers

Auth policy

Authentication is configured through an AuthPolicy:

JWT validation

MobKit validates JWT tokens locally without calling the identity provider at request time:
1

Header inspection

Parse the JWT header to extract the signing algorithm (alg) and key ID (kid):
Supported algorithms: HS256 (HMAC-SHA256) and RS256 (RSA-SHA256).
2

Key selection

For RS256 tokens, select the matching key from the JWKS document:
3

Signature verification

Verify the token signature against the selected key:
The validated JWT contains the claims (subject, email, issuer, expiration).

OIDC discovery

For RS256 providers, MobKit fetches the OIDC discovery document and JWKS keys:
The discovery document provides the JWKS URI, issuer, and supported algorithms. Keys are cached and refreshed when a token references an unknown kid.

HS256 shared secrets

For HMAC-based validation (testing, internal services):
HS256 is appropriate for internal service-to-service communication where both parties share the secret. Use RS256 with OIDC for user-facing authentication.

Console access enforcement

Console routes are protected by enforce_console_route_access:

Enforcement rules

  1. If console_policy.require_app_auth is false, all requests are allowed
  2. The request provider must match auth_policy.default_provider
  3. TestProvider is always rejected (even if it matches)
  4. The email must appear in auth_policy.email_allowlist
Console HTTP routes are designed for explicit bearer-token authentication. If a deployment puts cookie-based auth in front of the console, the deployment must also enforce CSRF/origin checks for mutation routes.

Service identity

Service accounts use the ServiceIdentity provider with emails prefixed by svc::
Service identities are validated separately:
  • The email must start with svc: and have content after the prefix
  • The full svc: identity must appear in the allowlist

Validation errors

See also