Next Auth extension for the Chatbot UI project
MIT License
This extension provides NextAuth SSO support to Chatbot UI.
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@latest
Turn on authentication for Chatbot UI by setting the following env variables.
Set the following in .env.local
.
NEXT_PUBLIC_AUTH_ENABLED=true
Set the following in .env.local
and in docker.env
:
NEXT_PUBLIC_AUTH_ENABLED=true
NEXTAUTH_URL_INTERNAL=http://chatbot:3000
Add the IDs and client secrets of the providers you want to enable in the env.local
file. See below.
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 [email protected]
|
|
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:
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