Skip to main content
When you build services next to Sinas — an internal API, a partner backend, a gateway — those services often receive Sinas access tokens and need to answer one question: is this token valid, and who is it for? By default Sinas signs access tokens with a symmetric secret (HS256), which only Sinas itself can verify. Switch to asymmetric signing and any standard JWT library can verify tokens offline — no shared secret, no per-request call back to Sinas:
That’s the only required change. On first boot Sinas generates an RSA keypair and persists it (encrypted) in its database, so every backend, worker, and scheduler process signs with the same key. To bring your own key instead:
Generate one with openssl genpkey -algorithm RSA -pkcs8 -out jwt-private.pem.
Switching the algorithm invalidates in-flight access tokens. They live 15 minutes by default, and clients refresh automatically — logged-in users won’t notice beyond one transparent refresh.

What changes with RS256

Access tokens gain the standard verification claims plus a key id header: The JWKS endpoint is unauthenticated (public keys are public) and the kid in each token’s header matches the published key, so libraries pick the right key automatically.

Verifying from your service

Point your JWT middleware at the JWKS URL and check issuer + audience. No Sinas SDK needed.

FastAPI / Python

Express / Node

Both libraries cache the JWKS response, so verification is a local signature check on the hot path.

Getting user profile data

The token proves identity; for profile data there’s an OIDC-style userinfo endpoint (works under both algorithms):
sub, email, and roles are always present. Every entry in the user’s custom fields appears as a plain claim — set by admins or by your backend during token exchange — so downstream services can authorize on org-specific attributes without extra lookups. Custom fields can never shadow the standard claims.

Configuration reference

Key resolution order: JWT_PRIVATE_KEY → JWT_PRIVATE_KEY_FILE → auto-generated and stored encrypted in the database.

What this is not

Sinas is not a full OIDC identity provider — there is no /authorize, consent, or dynamic client registration. If your organization runs Keycloak, Authentik, or another IdP, keep it as the source of truth and use token exchange to bring those users into Sinas instead.