This is a service that provides authentication for the other services in the system.
Registration, login, logout, email verification, SMS verification. magic links. password Reset, webhooks, JWTs, token refresh, OAuth (Configurable token providers, Linking oAuth to user profile), MFA (SMS-based, OTPs, Authenticator apps), rate limiting, CAPTCHA, audit trail, roles and caps
- Reference
- Endpoints
- POST /register
- POST /login
- POST /password/forgot
- GET /password/reset/:token
- POST /password/reset/:token
- GET /oauth/:provider
- Get /oauth/:provider/callback
- POST /oauth/link
- POST /login/magic
- GET /login/magic/:token
- GET /token/refresh
- GET /token/revoke
- POST /email/verify
- GET /email/verify/:token
- POST /mfa/setup
- POST /mfa/verify
- POST /mfa/remove
- POST /otp/send
- POST /otp/verify
- POST /otp/remove
- POST /authenticator/setup
- POST /authenticator/verify
- GET /user
- GET /user/:user_id
- POST /user
- PUT /user/:user_id
- GET /webhooks
- POST /webhooks
- PUT /webhooks/:webhook_id
- DELETE /webhooks/:webhook_id
- GET /audit/logs
Register a new user.
{
"email": "example@mail.com", // required
"password": "password123", // optional, if not provided, a random password will be generated
"options": {
"sendEmail": true, // optional
"sendSms": true, // optional
"setCookie": true // optional
"sendResetEmail": true // optional, will send a password reset email if password is not provided
"verifyEmail": true // optional, will send a verification email when the user is created
}
}
Sets a cookie with the JWT if options.setCookie
is true.
Authenticates a user via username/password and returns a JWT.
{
"email": "example@mail.com", // required
"password": "password123", // required
"options": {
"setCookie": true // optional, will set a cookie with the JWT, defaults to true
}
}
Sets a cookie with the JWT if options.setCookie
is true.
Authenticates a user via an OAuth provider
None
Callback for OAuth provider
This endpoint is not meant to be called directly
Logs out the user and clears the JWT cookie. Also revokes the refresh token.
None
200 Clears the JWT cookie.