Skip to main content

Integration patterns

IdentSphere works with any language. The Rust + TypeScript packages are the fastest path, but they are not the only path.

note

The core model is the same one every major auth provider uses: IdentSphere is a service, and your backend authorizes each request by validating the RS256 access token locally against the cached JWKS — no network hop per request, in any language. For the per-language verifier snippets and the full picture, see Validating tokens in your backend.

Two patterns, pick one​

Run identsphere-server as a Docker container alongside your application. Your application calls IdentSphere over HTTP for auth operations.

┌─────────────────────────┐ ┌─────────────────────────┐
│ Your application │ │ identsphere-server │
│ (Python / Go / etc.) │ ◄──REST─►│ (Rust binary) │
└────────────┬────────────┘ └────────────┬────────────┘
│ │
▼ ▼
┌─────────────────────┐ ┌─────────────────────┐
│ Your app database │ │ IdentSphere schema │
│ (your tables) │ │ (auth tables) │
└─────────────────────┘ └─────────────────────┘
(same Postgres or different — your choice)

Best for: Python, Go, Ruby, PHP, Java, .NET — anything not Rust.

Pros: language-agnostic, zero auth code in your app, isolated upgrades.

Cons: extra service to deploy, +1 network hop (typically <2ms over localhost).

Pattern 2 — Local JWT validation (the standard model)​

IdentSphere issues standard RS256 JWTs. Your application validates them using any JWT library in your language, locally against the cached JWKS. IdentSphere still handles login / signup / all the user flows; your app just trusts the resulting tokens on the per-request hot path. This is how Auth0, Clerk, Keycloak, Supabase GoTrue, Ory, and SuperTokens all expect backends to authorize requests — see Validating tokens in your backend for the per-language snippets.

┌─────────────────────────┐ ┌─────────────────────────┐
│ Your application │ │ identsphere-server │
│ validates JWTs against │ ◄─JWKS fetch───┤ publishes /jwks.json │
│ /.well-known/jwks.json │ └─────────────────────────┘
└─────────────────────────┘

Best for: high-traffic services that don't want a round-trip per request — validation is local.

Pros: no extra service call per request, fully decoupled.

Cons: revocation has a propagation lag of (cache TTL + access token TTL).

Decision matrix​

You haveUse Pattern...Why
Rust + Axum(neither — use identsphere-axum directly as a crate)Native integration, all hooks available
TypeScript / React(use @identsphere/react)Typed hooks, refresh, CSRF — all handled
Python / Django / FastAPIPattern 1Sidecar + a small DRF/FastAPI wrapper; pure REST
GoPattern 2 (JWT validation)High-throughput services; revocation lag acceptable
Node (non-React)Pattern 1 or 2Both work; depends on framework
Ruby on RailsPattern 1Sidecar; ruby-jwt for validation if needed
Java / Kotlin (Spring)Pattern 1 or 2Spring Security's resource-server adapter handles JWKS natively
PHP (Laravel / Symfony)Pattern 1Sidecar; firebase/php-jwt for validation
Multi-language microservicesPattern 1 for writes, Pattern 2 for readsidentsphere-server is the single source of truth; services validate JWTs locally

What is the same regardless of pattern​

  • The HTTP contract. ~40 endpoints, documented in the API reference.
  • The token format. Standard RS256 JWTs with documented claims.
  • The cookie format. identsphere_at, identsphere_rt, identsphere_csrf — standard cookies, browsers handle them.
  • The data model. users, organizations, organization_memberships in your Postgres, documented in Schema. Your application can JOIN against these tables directly.

Specific language guides​

Every language page has a Verify tokens in your backend section showing the local-JWKS validation snippet for that language. The cross-language overview is Validating tokens in your backend.