|
| 1 | +--- |
| 2 | +title: Authentication |
| 3 | +tags: |
| 4 | + - authentication |
| 5 | + - security |
| 6 | + - keycloak |
| 7 | + - sso |
| 8 | + - oidc |
| 9 | +--- |
| 10 | + |
| 11 | +import { Callout, Steps } from "nextra/components"; |
| 12 | + |
| 13 | +**Authentication** in Lifecycle is powered by Keycloak, providing robust identity management and authorization capabilities to ensure the UI is protected and secure. |
| 14 | + |
| 15 | +By default, Lifecycle deploys a Keycloak instance configured via the `lifecycle-keycloak` Helm chart. This automated setup handles the creation of necessary realms, clients, and default users to get you started quickly without manual intervention. |
| 16 | + |
| 17 | +<Callout type="info"> |
| 18 | + For advanced configuration details and Helm chart values, refer to the |
| 19 | + [lifecycle-keycloak Helm Chart |
| 20 | + repository](https://github.com/GoodRxOSS/helm-charts/tree/main/charts/lifecycle-keycloak). |
| 21 | +</Callout> |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Default configuration |
| 26 | + |
| 27 | +When you install Lifecycle, the Keycloak operator automatically provisions the following defaults: |
| 28 | + |
| 29 | +- **Realm**: A default realm named `internal` is created. |
| 30 | +- **Default User**: Within the `internal` realm, a default user is provisioned. |
| 31 | + |
| 32 | +The default credentials for this user are: |
| 33 | + |
| 34 | +- **Username**: `lifecycle` |
| 35 | +- **Password**: `lifecycle` |
| 36 | + |
| 37 | +This allows you to log in to the Lifecycle UI immediately after installation without any additional configuration. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## Configuring an external OIDC provider |
| 42 | + |
| 43 | +If you prefer to use an external OIDC provider (such as Okta, Auth0, or Azure AD) instead of the default Keycloak setup, you can easily configure Keycloak to federate authentication to your provider. |
| 44 | + |
| 45 | +Here is how you can set up an external OIDC provider: |
| 46 | + |
| 47 | +<Callout type="info"> |
| 48 | + To log in to the Keycloak Admin Console, you need the bootstrap administrator |
| 49 | + credentials. By default, these are stored in a Kubernetes secret named |
| 50 | + `lifecycle-keycloak-bootstrap-admin` within the namespace where Keycloak and |
| 51 | + Lifecycle are installed (default is `lifecycle-app`). |
| 52 | +</Callout> |
| 53 | + |
| 54 | +<Steps> |
| 55 | +### Access Keycloak Admin Console |
| 56 | +Log in to your Keycloak Admin Console using your administrator credentials. |
| 57 | + |
| 58 | +### Select the realm |
| 59 | + |
| 60 | +Select the **lifecycle** realm from the top-left dropdown menu. |
| 61 | + |
| 62 | +### Navigate to Identity Providers |
| 63 | + |
| 64 | +In the left-hand menu, click on **Identity Providers**. |
| 65 | + |
| 66 | +### Select the SSO provider |
| 67 | + |
| 68 | +Select the **company-sso** provider from the list of available identity providers. |
| 69 | + |
| 70 | +### Update provider settings |
| 71 | + |
| 72 | +Update the following settings to match your external provider (e.g., Okta): |
| 73 | + |
| 74 | +- **Client Authentication**: Change this from `jwt` to `Client secret sent as basic auth`. |
| 75 | +- **Client ID**: Replace with the Client ID provided by your external OIDC provider. |
| 76 | +- **Client Secret**: Replace with the Client Secret provided by your external OIDC provider. |
| 77 | +- **Authorization URL**: Update to your provider's authorization endpoint. |
| 78 | +- **Token URL**: Update to your provider's token endpoint. |
| 79 | +- **JWKS URL**: Update to your provider's JSON Web Key Set endpoint. |
| 80 | + |
| 81 | +### Save changes |
| 82 | + |
| 83 | +Click **Save** to apply your changes. |
| 84 | + |
| 85 | +</Steps> |
| 86 | + |
| 87 | +Once configured, users will be able to authenticate using your external OIDC provider when accessing the Lifecycle UI. |
| 88 | + |
| 89 | +<Callout type="tip"> |
| 90 | + Ensure that your external OIDC provider is configured to allow redirects back |
| 91 | + to your Keycloak instance's URL. |
| 92 | +</Callout> |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## Summary |
| 97 | + |
| 98 | +| Feature | Details | |
| 99 | +| :---------------------- | :------------------------------------------------------------------------- | |
| 100 | +| **Provider** | Keycloak | |
| 101 | +| **Default Realm** | `internal` | |
| 102 | +| **Default Credentials** | `lifecycle` / `lifecycle` | |
| 103 | +| **External OIDC** | Supported via the `company-sso` identity provider in the `lifecycle` realm | |
| 104 | +| **Helm Chart** | `lifecycle-keycloak` | |
0 commit comments