Skip to content

Node/Express API Example

Reference implementation for OIDC callback and refresh token rotation in Express.

Install

npm install express @last1id/sdk@0.3.0

Endpoints

  • GET /auth/last1/start -> create PKCE and redirect to Last1 authorize URL.
  • GET /auth/last1/callback -> exchange code and persist token set.
  • POST /auth/last1/refresh -> rotate refresh token with refreshToken().

Issuer

Use https://auth.last1.id. client_id is Copy Client ID (UUID) or the App ID slug.

Notes

  • Validate state and nonce.
  • Store refresh tokens encrypted at rest.
  • Keep redirect URI exact-match with app client config.