Node/Express API Example¶
Reference implementation for OIDC callback and refresh token rotation in Express.
Install¶
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 withrefreshToken().
Issuer¶
Use https://auth.last1.id. client_id is Copy Client ID (UUID) or the App ID slug.
Notes¶
- Validate
stateandnonce. - Store refresh tokens encrypted at rest.
- Keep redirect URI exact-match with app client config.