Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#65770] Document how to configure SCIM clients

Pavel Balashou236d521e75f5
diff --git a/app/views/admin/scim_clients/edit.html.erb b/app/views/admin/scim_clients/edit.html.erb
index 52f2b437dd4..552a22b55f5 100644
--- a/app/views/admin/scim_clients/edit.html.erb
+++ b/app/views/admin/scim_clients/edit.html.erb
@@ -32,7 +32,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { @scim_client.name }
- header.with_description { t("admin.scim_clients.form.description_html", docs_url: "#") } # TODO: Deep link into documentation
+ header.with_description { t("admin.scim_clients.form.description_html", docs_url: ::OpenProject::Static::Links[:sysadmin_docs][:scim][:href]) }
header.with_breadcrumbs(
[{ href: admin_index_path, text: t(:label_administration) },
{ href: admin_settings_authentication_path, text: t(:label_authentication) },
diff --git a/config/locales/en.yml b/config/locales/en.yml
index e6cbe50bab8..eea8cc2fbe4 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -130,7 +130,7 @@ en:
one_time_hint: "This is the only time you will see the client secret. Make sure to copy it now."
created_token_dialog_component:
title: "Token created"
- heading: "An token has been generated"
+ heading: "A token has been generated"
label_token: "Token"
one_time_hint: "This is the only time you will see this token. Make sure to copy it now."
delete_scim_client_dialog_component:
diff --git a/config/static_links.yml b/config/static_links.yml
index 6b6fdf84dc4..2f0fe048294 100644
--- a/config/static_links.yml
+++ b/config/static_links.yml
@@ -160,6 +160,8 @@ sysadmin_docs:
href: https://www.openproject.org/docs/system-admin-guide/authentication/openid-providers/#step-7-claims
saml:
href: https://www.openproject.org/docs/system-admin-guide/authentication/saml/
+ scim:
+ href: https://www.openproject.org/docs/system-admin-guide/authentication/scim/
text_formatting:
href: https://www.openproject.org/docs/user-guide/wysiwyg/
label: :setting_text_formatting
diff --git a/docs/system-admin-guide/authentication/oauth-applications/README.md b/docs/system-admin-guide/authentication/oauth-applications/README.md
index 85ab9b25dde..d85d168ee25 100644
--- a/docs/system-admin-guide/authentication/oauth-applications/README.md
+++ b/docs/system-admin-guide/authentication/oauth-applications/README.md
@@ -28,7 +28,7 @@ You can configure the following options to add your OAuth application:
3. Set the **Scopes** that the OAuth client application will be
able to access. Multiple selection is possible.
If no scope is checked, per default **api_v3** is assumed.
- api_v3 is the standard OpenProject API, while
+ **api_v3** is the standard OpenProject API, while
[bcf_v2_1](../../../api/bcf-rest-api) is specific to the BIM edition of
OpenProject.
4. Check if the application will be **Confidential**.
@@ -52,18 +52,18 @@ The authentication endpoints of OpenProject OAuth2 server are:
* Auth URL: `https://example.com/oauth/authorize`
* Access Token URL: `https://example.com/oauth/token`
-## *Authorization code flow* example
-
-### Request authorization code
+## Obtaining OAuth2 access token
+### *Authorization code flow* example
+#### Request authorization code
Request an authorization code. Please adopt the following URL replacing:
* `example.com` with the IP/host name of your OpenProject instance,
* `<Client ID>` with your OAuth2 client ID, and
* `<Redirect URI>` with the redirect URI as configured above.
-* You can leave the `scope` value untouched unless you are running the OpenProject BIM edition and also plan to access to the BCF version 2.1 REST API. Then simply replace `api_v3` with `api_v3%20bcf_v2_1`.
+* `<scope>` with list of scope values separated with `%20`. e.g. `scim_v2%20api_v3`
-`https://example.com/oauth/authorize?response_type=code&client_id=<Client ID>&redirect_uri=<Redirect URI>&scope=api_v3&prompt=consent`
+`https://example.com/oauth/authorize?response_type=code&client_id=<Client ID>&redirect_uri=<Redirect URI>&scope=<scope>&prompt=consent`
This requests redirects you to a URL that holds a `code` parameter
which is the authentication code.
@@ -76,7 +76,7 @@ In this example we skip that server side implementation and just
copy the value of the `code` parameter from the URL that you see
in your browser.
-### Request API token
+#### Request OAuth access token
With the authorization code that you obtained above you can now
request an API token.
@@ -116,23 +116,48 @@ The response will look like this:
The response contains the bearer token ("access_token") and a refresh token that you will need when working with the API.
Please copy the tokens for reference.
-### Perform a request to the OpenProject API with OAuth token
+### *Client credentials flow* example
+#### Request OAuth access token
-With the token that you obtained above you can now make API calls to the OpenProject instance on behalf of the current user.
+With client credentials you can request an API token directly from `/oauth/token` endpoint.
-For example, the following cURL command fetches all projects from the API V3. Please replace:
+We do this manually in the command line using cURL. Please replace:
-* `example.com` with the IP/host name of your OpenProject instance, and
-* `<Token>` with the bearer token you obtained above.
+* `example.com` with the IP/host name of your OpenProject instance,
+* `<Client ID>` with your OAuth2 client ID,
+* `<Client secret>` with your OAuth2 client secret,
+* `<scope>` with list of scope values separated with `%20`. e.g. `scim_v2%20api_v3`
```shell
-$ curl --request GET 'https://example.com/api/v3/projects' \
- --header 'Authorization: Bearer <Token>'`
+$ curl --request POST \
+ --url 'https://example.com/oauth/token' \
+ --header 'content-type: application/x-www-form-urlencoded' \
+ --data grant_type=client_credentials \
+ --data client_id=<Client ID> \
+ --data client_secret=<Client secret> \
+ --data scope=<scope>
+```
+
+The response will look like this:
+
+```json
+{
+ "access_token": "Ize6vvCIeENQ_suzd9kBJ6BxDNpxcumfTfweZQaOoJc",
+ "token_type": "Bearer",
+ "expires_in": 7200,
+ "refresh_token": "kDQ5pxzOE_4kCSKzONZaI1ogcyjcXk97_KhBS0JfCw4",
+ "scope": "scim_v2 api_v3",
+ "created_at": 1652112852
+}
```
-## Using Postman with OAuth2
+The response contains the bearer token ("access_token") and a refresh token that you will need when working with the API.
+Please copy the tokens for reference.
+
+
+### Using Postman to obtain access tokens
-You can exercise the authentication flow above using Postman.
+You can exercise the flows above using Postman.
Just create a new request:
```text
@@ -155,7 +180,23 @@ Please note that your Bearer token will expire after two hours (default)
and you will have to click on "Request Token" again. Otherwise your
API request will return an error message.
-## CORS headers
+## Performing a request to the OpenProject API with OAuth2 access token
+
+With the token that you obtained above you can now make API calls to the OpenProject instance on behalf of the current user.
+
+For example, the following cURL command fetches all projects from the API V3. Please replace:
+
+* `example.com` with the IP/host name of your OpenProject instance, and
+* `<Token>` with the bearer token you obtained above.
+
+```shell
+$ curl --request GET 'https://example.com/api/v3/projects' \
+ --header 'Authorization: Bearer <Token>'`
+```
+
+
+
+### CORS headers
By default, the OpenProject API is _not_ responding with any CORS headers.
If you want to allow cross-domain AJAX calls against your OpenProject instance, you need to enable CORS headers being returned.
diff --git a/docs/system-admin-guide/authentication/scim/README.md b/docs/system-admin-guide/authentication/scim/README.md
new file mode 100644
index 00000000000..beb9312660a
--- /dev/null
+++ b/docs/system-admin-guide/authentication/scim/README.md
@@ -0,0 +1,78 @@
+---
+sidebar_navigation:
+ title: SCIM
+ priority: 800
+description: SCIM
+keywords: SCIM
+---
+# SCIM provisioning (Enterprise add-on)
+
+> [!IMPORTANT]
+> SCIM provisioning is an Enterprise add-on. If you do not see the button you will have to activate the Enterprise edition first.
+
+To activate and configure SCIM user and group provisioning in OpenProject, navigate to *Administration* -> *Authentication* and select -> *SCIM provisioning*.
+
+## Configure new SCIM client.
+
+SCIM client is a system(e.g. Keycloak with [SCIM plugin](https://github.com/mitodl/keycloak-scim)) that uses SCIM protocol to provision user and group identities in an automated and standardized way.
+A SCIM client sends requests to a SCIM server (OpenProject in this case), asking it to create, update, retrieve, or delete users and groups.
+To add a new SCIM client, click the green **+ SCIM client** button.
+
+![Add SCIM client. Index page creation button.](add_scim_1.png)
+
+Configure your SCIM client in the following form:
+
+1. Enter the **Name** of your SCIM client.
+
+ ![Add SCIM client. Creation form. Name field.](add_scim_2.png)
+2. Choose an **Authentication provider**.
+ This is the service that users added by the SCIM provider will use to authenticate in OpenProject.
+ It must have been configured before creating the SCIM client. It can be an [OIDC provider](../system-admin-guide/authentication/openid-providers/) or a [SAML provider](../system-admin-guide/authentication/saml/).
+
+ ![Add SCIM client. Initial creation form. Authentication provider field.](add_scim_3.png)
+3. Choose an **Authentication method**.
+ This is how the SCIM client authenticates at OpenProject. Please ensure that OAuth tokens include the **scim_v2** scope.
+ There are three option:
+ a. **Static access token**
+
+ > [!IMPORTANT]
+ > Static access tokens are valid for period of 1 year. Then they expire and must be replaced.
+
+ This is the most commonly used authentication method for SCIM clients. In this case after clicking **Create** you get an access token that should be put to the SCIM client configuration on the other end.
+
+ ![Add SCIM client. Creation form. Static access token. Generate token. ](add_scim_4.png)
+
+ There is generated access token. After closing the dialog with generated token you will not see it anymore.
+
+ ![Add SCIM client. Creation form. Static access token. Copy token.](add_scim_5.png)
+
+ Tokens can be revoked. And you can generate a new one.
+
+ ![Add SCIM client. Creation form. Static access token. Revoke token.](add_scim_6.png)
+
+ For example, if you use Keycloak with [SCIM plugin](https://github.com/mitodl/keycloak-scim) then configuration form looks like:
+
+ ![Add SCIM client. Keycloak configuration form.](add_scim_10.png)
+
+ 1. Fill in the **UI Display name**
+ 2. Fill in the **SCIM 2.0 endpoint**
+ It must be in the following form: `https://<your_openproject_hostanme>/scim_v2/`
+ 3. Set **Endoint content type** to **application/scim+json**
+ 4. Set **Auth mode** to **Bearer**
+ 5. Paste the generated static access token to **Auth password/token**
+ 6. Enable user and group propagation. Enable import during sync.
+ 7. **Save** the configuration.
+
+ b. **OAuth 2.0 client credentials**
+ In this case after clicking **Create** you get client credentials of newly created [OpenProject OAuth Application](../oauth-applications/#oauth-applications) that should be put to the SCIM client configuration on the other end. Then SCIM client is supposed to use provided client credentials to send an access token request to OpenProject.
+
+ ![Add SCIM client. Creation form. Client credentials. Generate client credentials.](add_scim_7.png)
+
+ There are generated client id and client secret. After closing the dialog with not see client secret anymore.
+
+ ![Add SCIM client. Creation form. Client credentials. Copy client credentials.](add_scim_8.png)
+
+ c. **JWT from identity provider**
+ In this case you have to specify **Subject claim** that authentication JWT contains.
+
+ ![Add SCIM client. Creation form. JWT from identity provider. Specify Subject claim.](add_scim_9.png)
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_1.png b/docs/system-admin-guide/authentication/scim/add_scim_1.png
new file mode 100644
index 00000000000..f3abee282aa
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_1.png differ
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_10.png b/docs/system-admin-guide/authentication/scim/add_scim_10.png
new file mode 100644
index 00000000000..7b66817130d
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_10.png differ
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_2.png b/docs/system-admin-guide/authentication/scim/add_scim_2.png
new file mode 100644
index 00000000000..77f07fc00d1
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_2.png differ
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_3.png b/docs/system-admin-guide/authentication/scim/add_scim_3.png
new file mode 100644
index 00000000000..ba29bb512e6
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_3.png differ
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_4.png b/docs/system-admin-guide/authentication/scim/add_scim_4.png
new file mode 100644
index 00000000000..6888cca8e62
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_4.png differ
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_5.png b/docs/system-admin-guide/authentication/scim/add_scim_5.png
new file mode 100644
index 00000000000..04076fbf97e
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_5.png differ
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_6.png b/docs/system-admin-guide/authentication/scim/add_scim_6.png
new file mode 100644
index 00000000000..dfbaefcd2bd
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_6.png differ
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_7.png b/docs/system-admin-guide/authentication/scim/add_scim_7.png
new file mode 100644
index 00000000000..ed0130d200d
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_7.png differ
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_8.png b/docs/system-admin-guide/authentication/scim/add_scim_8.png
new file mode 100644
index 00000000000..8124f8150fd
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_8.png differ
diff --git a/docs/system-admin-guide/authentication/scim/add_scim_9.png b/docs/system-admin-guide/authentication/scim/add_scim_9.png
new file mode 100644
index 00000000000..cefb904c7bc
Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_9.png differ