OAuth2
Protects a route using a provider and the Oauth2 protocol
This plugin protects a given route by authenticating against a provider and a JWT token sent as an HTTP-only cookie for you particular domain.
Providers
github
workos
Options
Plugin options are always passed via the config
key.
provider
One of the providers listed above
client_id
Client ID of your app in the provider of your choosing
client_secret
Client Secret of your app in the provider of your choosing
jwt_secret
The secret for the JWT token used in the generate HTTP-only cookie. Needs to be at least 64 chars.
validations
An list (array) of validations for your provider
Validations
The OAuth2 plugins allows you to define whether a given user can access the domain requested.
Email
To only allow access from specific emails:
Username
To only allow access from specific usernames (depends on provider)
Combined
You can combine all validations together
Usage
A complete plugin definition looks like the following:
Last updated