Skip to main content
Kralis uses one SimpleJWT token family across its GraphQL and REST authentication interfaces. GraphQL is the recommended lifecycle and is also used by Kralis Web. The two login interfaces apply the same account, school, and Access-PIN rules and issue compatible access and refresh tokens. Choose one lifecycle and use it consistently in your client.

GraphQL authentication lifecycle

After login, send the access token and query the trusted context for the current request:

REST compatibility lifecycle

Confirm current REST fields in Swagger or ReDoc.

Authorize GraphQL calls

The login response includes deliberately limited user and school identity data. Fetch the live academic and Access-PIN context through viewer.accessContext, and fuller application data through the appropriate school-scoped GraphQL queries.

Refresh and revocation

After every successful refresh, replace both stored tokens with the returned access and refresh, even when the refresh value is unchanged by the current server policy. This keeps a client correct if token rotation is enabled later. If refresh fails with INVALID_TOKEN, clear local authentication and require sign-in. Coalesce concurrent refresh attempts so the same token is not submitted several times, and do not create an infinite retry loop.

Storage guidance

Never return tokens to logs, error trackers, browser URLs, screenshots, or public support messages.