|
| 1 | +# Configuration — Single Sign-On (SSO) |
| 2 | + |
| 3 | +With the release of version 1.7.0, Buggregator now supports Single Sign-On (SSO) using [Auth0](https://auth0.com/). This |
| 4 | +integration allows users to authenticate with external identity providers supported by Auth0, providing a secure and |
| 5 | +seamless sign-in experience. |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +By configuring SSO, you can streamline the authentication process and enhance the security of user management within |
| 10 | +your application. |
| 11 | + |
| 12 | +## Prerequisites |
| 13 | + |
| 14 | +To configure SSO in Buggregator, you must have an [auth0.com](https://auth0.com/) account. If you do not have one, you |
| 15 | +can sign up for free. |
| 16 | + |
| 17 | +## Configuration Steps |
| 18 | + |
| 19 | +To enable SSO, follow these steps: |
| 20 | + |
| 21 | +1. **Enable Authentication**: Set the environment variable `AUTH_ENABLED` to `true` to enable authentication features in |
| 22 | + your application. |
| 23 | + |
| 24 | +2. **Create an Auth0 Application**: Log in to your Auth0 account and create a new "Regular Web |
| 25 | + Application". After creating the application, you will receive a `Domain`, `Client ID` and `Client Secret` that you |
| 26 | + will need to use in the next steps. |
| 27 | + |
| 28 | +3. **Configure Auth0 Settings**: Set up the following environment variables with the appropriate values from your Auth0 |
| 29 | + application: |
| 30 | + |
| 31 | + - `AUTH_PROVIDER_URL`: The URL of your app domain, e.g., `https://<domain>.auth0.com` |
| 32 | + - `AUTH_CLIENT_ID`: The client ID provided by app. |
| 33 | + - `AUTH_CLIENT_SECRET`: The client secret provided by app. |
| 34 | + - `AUTH_CALLBACK_URL`: The callback URL that app will redirect to after authentication, |
| 35 | + e.g., `http://buggregator.server/auth/sso/callback`. Where `buggregator.server` is the domain of your Buggregator |
| 36 | + server. |
| 37 | + - `AUTH_SCOPES`: The scopes for which permissions are granted, typically include `openid`, `email`, and `profile`. |
| 38 | + |
| 39 | +4. **Set Up Callback URL**: In your Auth0 application settings, configure the callback URL to point to |
| 40 | + the `http://buggregator.server/auth/sso/callback` endpoint. Where `buggregator.server` is the domain of your |
| 41 | + Buggregator server. |
| 42 | + |
| 43 | +Resultant environment variables should look like this: |
| 44 | + |
| 45 | +```dotenv |
| 46 | +AUTH_ENABLED=true |
| 47 | +AUTH_PROVIDER_URL=https://<domain>.auth0.com |
| 48 | +AUTH_CLIENT_ID=xxx |
| 49 | +AUTH_CLIENT_SECRET=xxx |
| 50 | +AUTH_CALLBACK_URL=http://buggregator.server/auth/sso/callback |
| 51 | +AUTH_SCOPES=openid,email,profile |
| 52 | +``` |
| 53 | + |
| 54 | +### Verifying the Configuration |
| 55 | + |
| 56 | +After configuring the environment variables, start your Buggregator server. You should now see Login page with the |
| 57 | +option to sign in using Auth0. If set up correctly, clicking this option will redirect you to the Auth0 authentication |
| 58 | +page where users can enter their credentials. |
| 59 | + |
| 60 | +After successful authentication, users will be redirected back to the Buggregator application and logged in. And you |
| 61 | +will see the user's profile information in the bottom left corner of the application. |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +### Troubleshooting |
| 66 | + |
| 67 | +If you encounter issues during the authentication process, ensure that: |
| 68 | + |
| 69 | +- All environment variables are correctly set without any typos. |
| 70 | +- The callback URL in your Auth0 configuration matches the `AUTH_CALLBACK_URL` you specified. |
| 71 | +- Your Auth0 account has access to the scopes specified in `AUTH_SCOPES`. |
0 commit comments