1.0.13 • Published 3 years ago
chatbot-ui-authjs v1.0.13
Chatbot UI Next Auth Extension
This extension provides NextAuth SSO support to Chatbot UI.
Installation
Step 1
The extension comes pre-installed with the base version of Chatbot UI. However, if for any reason you need to re-install this extension, you can do so with npm:
npm i chatbot-ui-authjs@latestStep 2
Turn on authentication for Chatbot UI by setting the following env variables.
Local Build
Set the following in .env.local.
NEXT_PUBLIC_AUTH_ENABLED=trueDocker Build
Set the following in .env.local and in docker.env:
NEXT_PUBLIC_AUTH_ENABLED=true
NEXTAUTH_URL_INTERNAL=http://chatbot:3000Steps 3
Add the IDs and client secrets of the providers you want to enable in the env.local file. See below.
Configuration
When using this extension, the following environment variables can be set:
| Environment Variable | Default value | Description |
|---|---|---|
| NEXTAUTH_EMAIL_PATTERN | The email regex pattern granted access to chatbot-ui. For example .+@mydomain.com | |
| NEXTAUTH_SECRET | NextAuth Settings. See Documentation | |
| NEXTAUTH_URL | http://localhost:3000 | NextAuth Settings. See Documentation |
| NEXTAUTH_URL_INTERNAL | (Optional) NextAuth Settings. See Documentation. | |
| \<PROVIDER>_CLIENT_ID | Provider OAuth Client ID | |
| \<PROVIDER>_CLIENT_SECRET | Provider OAuth Client Secret |
Where \<PROVIDER> is one of the following:
- APPLE
- AUTH0
- COGNITO
- DISCORD
- GITHUB
- GITLAB
- OKTA
- SALESFORCE
- SLACK
- SPOTIFY
- TWITCH
For example, to enable Google and Github authentication, you would add the following to your .env.local file:
GITHUB_CLIENT_ID=xxxxxxxxxxxxx
GITHUB_CLIENT_SECRET=xxxxxxxxxxxxx
GOOGLE_CLIENT_ID=xxxxxxxxxxxxx
GOOGLE_CLIENT_SECRET=xxxxxxxxxxxx