-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Florent FAYOLLE
committed
Nov 14, 2023
1 parent
10e3eaf
commit a6aac4c
Showing
3 changed files
with
95 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
OpenID Connect {: .tag-core .tag-ee } | ||
==== | ||
|
||
Configuration for OIDC, useful for organization single-sign-on logins. | ||
A good informative overview of OIDC is at <https://developer.okta.com/blog/2019/10/21/illustrated-guide-to-oauth-and-oidc> | ||
|
||
Note: | ||
|
||
* SP is "Service Provider", in our case, the Grist application. | ||
* IdP is the "Identity Provider", somewhere users log into, e.g. Keycloak, Authelia, ... | ||
* OIDC is the accronym for OpenID Connect | ||
|
||
Expected environment variables: | ||
|
||
* `GRIST_OIDC_SP_HOST` - this is just the base URL of the Grist site, | ||
such as `https://<grist-domain>` (when OIDC is active, there will | ||
be a `/oauth2/callback` endpoint available here for implementing the protocol). | ||
If omitted, `APP_HOME_URL` will be used. | ||
* `GRIST_OIDC_IDP_ISSUER` - the issuer URL for the IdP, passed to node-openid-client, see: <https://github.com/panva/node-openid-client/blob/a84d022f195f82ca1c97f8f6b2567ebcef8738c3/docs/README.md#issuerdiscoverissuer>. | ||
**This variable turns on the OIDC login system.** | ||
* `GRIST_OIDC_IDP_SCOPES` - the scopes to request from the IdP, as a space-separated list. Defaults to `"openid email profile"`. | ||
* `GRIST_OIDC_IDP_CLIENT_ID` - the client ID for the application, as registered with the IdP. | ||
* `GRIST_OIDC_IDP_CLIENT_SECRET` - the client secret for the application, as registered with the IdP. | ||
|
||
## Example: Gitlab | ||
|
||
See [how to create an OAuth2 application in Gitlab in this documentation](https://docs.gitlab.com/ee/integration/oauth_provider.html). The redirection URI should be `https://<grist-domain>/oauth2/callback` (or `http://localhost:8484/oauth2/callback` if tested locally, change `8484` to the port you listen on). | ||
|
||
Once the application is set up and start grist with these settings: | ||
|
||
- `GRIST_OIDC_SP_HOST` = `https://<grist-domain>` / `http://localhost:8484` | ||
- `GRIST_OIDC_IDP_ISSUER` = `https://gitlab.com/.well-known/openid-configuration` | ||
- `GRIST_OIDC_IDP_SCOPES` = `"openid profile email"` | ||
- `GRIST_OIDC_IDP_CLIENT_ID` = "..." (the client ID generated by Gitlab for the application) | ||
- `GRIST_OIDC_IDP_CLIENT_SECRET` = "..." (the client secret generated by Gitlab for the application) | ||
|
||
## Example: Auth0 | ||
|
||
Create an application in Auth0 [as explained in this documentation](https://auth0.com/docs/get-started/auth0-overview/create-applications) (you can select the app type named `Regular Web Applications`). Once the application created, ensure to add at least the following configuration for the app: | ||
|
||
* Allowed callback URLs: `https://<grist-domain>/oauth2/callback` | ||
* Allowed logout URLs: `http://<grist-domain>/*` (you can also replace the wildcard with the whole path in order to be stricter) | ||
|
||
Then you should be able to start Grist with the following settings: | ||
|
||
- `GRIST_OIDC_SP_HOST` = `https://<grist-domain>` / `http://localhost:8484` | ||
- `GRIST_OIDC_IDP_ISSUER` = `https://<your-auth0-app-domain>` | ||
- `GRIST_OIDC_IDP_SCOPES` = `"openid profile email"` | ||
- `GRIST_OIDC_IDP_CLIENT_ID` = "..." (the client ID generated by Auth0 for the application) | ||
- `GRIST_OIDC_IDP_CLIENT_SECRET` = "..." (the client secret generated by Auht0 for the application) | ||
|
||
## Example: Keycloak | ||
|
||
First of all, setup Keycloak as explained in one of these "Getting started" guides: <https://www.keycloak.org/guides#getting-started>. | ||
|
||
Once keycloak is setup, with a realm and a user, create a new client with the following configuration: | ||
|
||
- Client type: OpenID Connect | ||
- Authentication flow: Standard Flow | ||
- Root URL: `https://<grist-domain>` | ||
- Valid redirect URIs: `/oauth2/callback` | ||
- Valid post logout redirect URIs: `/*` (you can also replace the wildcard with the whole path in order to be stricter) | ||
|
||
Submit your settings and go to the Credentials tab to retrieve the client Secret. | ||
|
||
Then, you can start Grist with the following configuration: | ||
|
||
- `GRIST_OIDC_SP_HOST` = `https://<grist-domain>` / `http://localhost:8484` | ||
- `GRIST_OIDC_IDP_ISSUER` = `https://<keycloak-domain>/realms/<your-realm>` | ||
- `GRIST_OIDC_IDP_SCOPES` = `"openid profile email"` | ||
- `GRIST_OIDC_IDP_CLIENT_ID` = "..." (the ID you chose for the Keycloak client) | ||
- `GRIST_OIDC_IDP_CLIENT_SECRET` = "..." (the client secret generated by Keycload retrieved earlier) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters