|
| 1 | +--- |
| 2 | +title: Configure Okta Identity Verification Service for LobeChat |
| 3 | +description: >- |
| 4 | + Learn how to configure Okta Identity Verification Service for LobeChat for your organization, including creating applications, adding users, and configuring environment variables. |
| 5 | +
|
| 6 | +tags: |
| 7 | + - Okta |
| 8 | + - Identity Verification |
| 9 | + - Single Sign-On |
| 10 | + - Environment Variables |
| 11 | + - User Management |
| 12 | + - SSO Integrations |
| 13 | + - Social Login |
| 14 | +--- |
| 15 | + |
| 16 | +# Configure Okta Identity Verification Service |
| 17 | + |
| 18 | +<Steps> |
| 19 | + ### Create Okta Application |
| 20 | + |
| 21 | + Register and log in to [Okta][okta-client-page], open the "Applications" subtab in the left navigation bar, and click "Applications" to switch to the application management interface. click "Create App Integration" in the upper left corner to create an application. |
| 22 | + |
| 23 | + Select "OIDC - OpenID Connect" in Sign-In Method and then select "Web Application" in Application Type. |
| 24 | + |
| 25 | + Fill in the following settings: |
| 26 | + |
| 27 | + | Setting Name | Description | Sample Information | |
| 28 | + | ---------------------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------- | |
| 29 | + | App Integration Name | The Application Name your users will see | LobeChat Instance | |
| 30 | + | Sign-in redirect URIs | Okta sends the authentication response and ID token for the user's sign-in request to these URIs | (http(s)://your-domain/api/auth/callback/okta | |
| 31 | + | Sign-out redirect URIs | After your application contacts Okta to close the user session, Okta redirects the user to one of these URIs | (http(s)://your-domain | |
| 32 | + |
| 33 | + <Callout type={'important'}> |
| 34 | + You can fill in or modify all the fields after deployment, but make sure the filled URL is |
| 35 | + consistent with the deployed URL. |
| 36 | + </Callout> |
| 37 | + |
| 38 | + ### Add Users |
| 39 | + |
| 40 | + Click on the "Assignments" in the top navigation bar to enter the user management interface, where you can create or assign users in your organization to log in to LobeChat. |
| 41 | + |
| 42 | + ### Configure Environment Variables |
| 43 | + |
| 44 | + When deploying LobeChat, you need to configure the following environment variables: |
| 45 | + |
| 46 | + | Environment Variable | Type | Description | |
| 47 | + | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 48 | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` | |
| 49 | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `okta` for Okta. | |
| 50 | + | `AUTH_OKTA_ID` | Required | Client ID of the Okta application | |
| 51 | + | `AUTH_OKTA_SECRET` | Required | Client Secret of the Okta application | |
| 52 | + | `AUTH_OKTA_ISSUER` | Required | Domain of the Okta application, `https://example.oktapreview.com` | |
| 53 | + | `NEXTAUTH_URL` | Optional | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` | |
| 54 | + |
| 55 | + <Callout type={'tip'}> |
| 56 | + You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variable/auth#okta). |
| 57 | + </Callout> |
| 58 | +</Steps> |
| 59 | + |
| 60 | +<Callout> |
| 61 | + After successful deployment, users will be able to authenticate and use LobeChat using the users |
| 62 | + configured in Okta. |
| 63 | +</Callout> |
| 64 | + |
| 65 | +[okta-client-page]: https://login.okta.com |
0 commit comments