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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#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.erbindex 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.ymlindex 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.ymlindex 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-claimssaml: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_formattingdiff --git a/docs/system-admin-guide/authentication/oauth-applications/README.md b/docs/system-admin-guide/authentication/oauth-applications/README.mdindex 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 beable 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 ofOpenProject.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 codeRequest 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` parameterwhich is the authentication code.@@ -76,7 +76,7 @@ In this example we skip that server side implementation and justcopy the value of the `code` parameter from the URL that you seein your browser.-### Request API token+#### Request OAuth access tokenWith the authorization code that you obtained above you can nowrequest 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 yourAPI 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 headersBy 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.mdnew file mode 100644index 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.++++Configure your SCIM client in the following form:++1. Enter the **Name** of your SCIM client.++ +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/).++ +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.++ ++ There is generated access token. After closing the dialog with generated token you will not see it anymore.++ ++ Tokens can be revoked. And you can generate a new one.++ ++ For example, if you use Keycloak with [SCIM plugin](https://github.com/mitodl/keycloak-scim) then configuration form looks like:++ ++ 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.++ ++ There are generated client id and client secret. After closing the dialog with not see client secret anymore.++ ++ c. **JWT from identity provider**+ In this case you have to specify **Subject claim** that authentication JWT contains.++ diff --git a/docs/system-admin-guide/authentication/scim/add_scim_1.png b/docs/system-admin-guide/authentication/scim/add_scim_1.pngnew file mode 100644index 00000000000..f3abee282aaBinary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_1.png differdiff --git a/docs/system-admin-guide/authentication/scim/add_scim_10.png b/docs/system-admin-guide/authentication/scim/add_scim_10.pngnew file mode 100644index 00000000000..7b66817130dBinary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_10.png differdiff --git a/docs/system-admin-guide/authentication/scim/add_scim_2.png b/docs/system-admin-guide/authentication/scim/add_scim_2.pngnew file mode 100644index 00000000000..77f07fc00d1Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_2.png differdiff --git a/docs/system-admin-guide/authentication/scim/add_scim_3.png b/docs/system-admin-guide/authentication/scim/add_scim_3.pngnew file mode 100644index 00000000000..ba29bb512e6Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_3.png differdiff --git a/docs/system-admin-guide/authentication/scim/add_scim_4.png b/docs/system-admin-guide/authentication/scim/add_scim_4.pngnew file mode 100644index 00000000000..6888cca8e62Binary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_4.png differdiff --git a/docs/system-admin-guide/authentication/scim/add_scim_5.png b/docs/system-admin-guide/authentication/scim/add_scim_5.pngnew file mode 100644index 00000000000..04076fbf97eBinary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_5.png differdiff --git a/docs/system-admin-guide/authentication/scim/add_scim_6.png b/docs/system-admin-guide/authentication/scim/add_scim_6.pngnew file mode 100644index 00000000000..dfbaefcd2bdBinary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_6.png differdiff --git a/docs/system-admin-guide/authentication/scim/add_scim_7.png b/docs/system-admin-guide/authentication/scim/add_scim_7.pngnew file mode 100644index 00000000000..ed0130d200dBinary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_7.png differdiff --git a/docs/system-admin-guide/authentication/scim/add_scim_8.png b/docs/system-admin-guide/authentication/scim/add_scim_8.pngnew file mode 100644index 00000000000..8124f8150fdBinary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_8.png differdiff --git a/docs/system-admin-guide/authentication/scim/add_scim_9.png b/docs/system-admin-guide/authentication/scim/add_scim_9.pngnew file mode 100644index 00000000000..cefb904c7bcBinary files /dev/null and b/docs/system-admin-guide/authentication/scim/add_scim_9.png differ