LPsLux Proposals
Wallets & Identity
LP-7120

Identity and Access Management

Final

One OIDC provider issues every token; every service validates the signature against its JWKS, checks audience and expiry, and scopes every query to the org in the owner claim — so no service keeps a user database of its own

Category
Core
Created
2020-03-01

Abstract

One OIDC provider — Hanzo IAM at hanzo.id — issues every token. Every authenticated service validates the JWTs IAM issued; the owner claim in the token scopes all data queries to the organization. No service maintains a user database of its own, and no service builds its own authentication.

Specification

Architecture

Client -> Hanzo IAM (hanzo.id) -> JWT (id_token + access_token)
Client -> Service API (Bearer token) -> Validate JWT -> Extract org from owner claim

Token format

Access tokens are JWTs signed with RS256.

ClaimTypeDescription
substringUser ID
ownerstringOrganization ID; scopes all queries
audstringTarget service audience
scopestringSpace-separated scopes
iatuint64Issued-at timestamp
expuint64Expiration timestamp

Authorization flows

FlowUse case
Authorization Code with PKCEWeb and mobile apps
Client CredentialsService to service (LP-7110)
Device AuthorizationCLI tools, IoT

Service integration

Every service MUST:

  1. validate the JWT signature against IAM's JWKS endpoint (hanzo.id/.well-known/jwks.json);
  2. check the exp and aud claims;
  3. extract owner from the JWT and scope every database query to that organization;
  4. reject tokens with a missing or empty owner.

Gateway integration

The API gateway validates tokens at the edge and injects X-Hanzo-User and X-Hanzo-Org headers. Services behind the gateway may trust those headers without re-validating the JWT, because the gateway is the only path in.

Security Considerations

  1. Tokens are short-lived — 15 minutes. Refresh tokens rotate on each use.
  2. All secrets — client IDs, signing keys — live in KMS (LP-7330).
  3. PKCE is mandatory for every public client. There is no implicit flow.
  4. Token revocation is supported through the revocation endpoint.

Reference

ResourceLocation
IAMhttps://hanzo.id
JWKS endpointhttps://hanzo.id/.well-known/jwks.json
IAM implementationgithub.com/hanzoai/iam
Gatewaygithub.com/hanzoai/gateway

References

  • RFC 6749 — The OAuth 2.0 Authorization Framework
  • RFC 9126 — OAuth 2.0 Pushed Authorization Requests
  • OpenID Connect Core 1.0
  • LP-10093 — the on-chain identity standard IAM identities can bind to.

Copyright and related rights waived via CC0.