sourcegraph/dev/auth-provider
Quinn Slack cbac3c6390
remove more ENTERPRISE=1 remnants (#57232)
There are still many places that build the old non-enterprise bundle. This is no longer needed or maintained. This change simplifies our builds by removing that unnecessary target. There are still some remnants (such as `ui/assets/{enterprise,oss}`); not *all* are removed here.
2023-10-02 10:43:11 -07:00
..
config
scripts
keycloak.sh remove more ENTERPRISE=1 remnants (#57232) 2023-10-02 10:43:11 -07:00
README.md Remove left-over mentions of dev/start.sh (#25745) 2021-10-07 16:38:00 +02:00

Dev auth provider

Keycloak is an authentication provider that we use in development to test Sourcegraph's support for OpenID Connect and SAML. It serves the same role as OpenID Connect and SAML providers on Okta, OneLogin, Google Workspace, etc., but it runs locally and is easier to autoconfigure for use with your local dev server.

Using Keycloak in local dev

Keycloak is not started by default when you run sg start.

To enable it, run it separately with ./dev/auth-provider/keycloak.sh.

To use it, visit your local dev server's sign-in page and authenticate using an auth provider whose name contains "Keycloak".

Advanced

Most people don't need to keep reading.

Configuring Keycloak, adding users, etc.

If you need to edit client or user information and want to persist your changes:

  1. Start Keycloak, if you haven't already. See the above section for steps. The keycloak Docker container should be running.
  2. Edit the JSON files in config/ as needed.
  3. Run RESET=1 scripts/configure-keycloak.sh to clobber the existing configuration with the config/*.json files' configuration.

Not sure how to edit the JSON to achieve your desired outcome? Use the Keycloak admin interface at http://localhost:3220/auth (login as root/q) to change configuration, and then export to JSON.