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

Backport SAML doc changes to 12.3

Oliver Güntherd5959011adbe
diff --git a/docs/system-admin-guide/authentication/saml/README.md b/docs/system-admin-guide/authentication/saml/README.md
index 1fac64f868d..36c776ea283 100644
--- a/docs/system-admin-guide/authentication/saml/README.md
+++ b/docs/system-admin-guide/authentication/saml/README.md
@@ -7,13 +7,13 @@ keywords: SAML, SSO, single sign-on, authentication
---
# SAML
-> **Note**: This documentation is valid for the OpenProject Enterprise Edition only.
+> **NOTE**: This documentation is valid for the OpenProject Enterprise Edition only.
You can integrate your active directory or other SAML compliant identity provider in your OpenProject Enterprise Edition.
## Enterprise Cloud
-For the moment in the Enterprise cloud OpenProject DevOps team has to apply the configuration for you. The configuration has to be provided in a support ticket, for instance as a YAML file as described in the docs.
+For the moment in the Enterprise cloud OpenProject DevOps team has to apply the configuration for you. The configuration has to be provided in a support ticket, e.g. as an ENV environment file.
Experience shows that configuring this can be tricky, though. So it may take a bit until the correct configuration is finished with your SAML provider.
If you have the chance to test the SAML configuration on an Enterprise on-premises installation this might speed things up. But we can make it work either way.
@@ -34,94 +34,23 @@ In order to use integrate OpenProject as a service provider (SP) using SAML, you
The configuration can be provided in one of two ways:
-* `config/configuration.yml` file (1.1)
+* Environment variables (1.1)
-* Environment variables (1.2)
+* Settings in the database (1.2)
-* Settings in the database (1.3)
+* for OpenProject version 11 and older in `config/configuration.yml` file (1.3)
-Whatever means are chosen, the plugin simply passes all options to omniauth-saml. See [their configuration
-documentation](https://github.com/omniauth/omniauth-saml#usage) for further details.
+Whatever means are chosen, the plugin simply passes all options to omniauth-saml. See [their configuration documentation](https://github.com/omniauth/omniauth-saml#usage) for further details.
-The options are mutually exclusive. I.e. if settings are already provided via ENV variables, they will overwrite settings in a `configuration.yml` file.
-If you decide to save settings in the database, they will override any ENV variables you might have set.
+The options are mutually exclusive. If you decide to save settings in the database, they will override any ENV variables you might have set. (*For OpenProject version 11 and older:* If settings are already provided via ENV variables, they will overwrite settings in a `configuration.yml` file.)
-#### 1.1 config/configuration.yml file
-
-In your OpenProject packaged installation, you can modify the `/opt/openproject/config/configuration.yml` file.
-Edit the file in your favorite editor
-
-```
-vim /opt/openproject/config/configuration.yml
-```
-
-This will contains the complete OpenProject configuration and can be extended to also contain metadata settings and connection details for your SSO identity provider.
-
-The following is an exemplary file with a set of common settings:
-
-```yaml
-default:
- # <-- other configuration -->
- saml:
- # First SAML provider
- mysaml1:
- # Name of the provider, leave this at saml unless you use multiple providers
- name: "saml"
- # The name that will be display in the login button
- display_name: "My SSO"
- # Use the default SAML icon
- icon: "auth_provider-saml.png"
-
- # The callback within OpenProject that your idP should redirect to
- assertion_consumer_service_url: "https://<YOUR OPENPROJECT HOSTNAME>/auth/saml/callback"
- # The SAML issuer string that OpenProject will call your idP with
- issuer: "https://<YOUR OPENPROJECT HOSTNAME>"
-
- # IF your SSL certificate on your SSO is not trusted on this machine, you need to add it here in ONE line
- ### one liner to generate certificate in ONE line
- ### awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <yourcert.pem>
- #idp_cert: "-----BEGIN CERTIFICATE-----\n ..... SSL CERTIFICATE HERE ...-----END CERTIFICATE-----\n"
- # Otherwise, the certificate fingerprint must be added
- # Either `idp_cert` or `idp_cert_fingerprint` must be present!
- idp_cert_fingerprint: "E7:91:B2:E1:..."
-
- # Replace with your SAML 2.0 redirect flow single sign on URL
- # For example: "https://sso.example.com/saml/singleSignOn"
- idp_sso_target_url: "<YOUR SSO URL>"
- # Replace with your redirect flow single sign out URL
- # or comment out
- # For example: "https://sso.example.com/saml/proxySingleLogout"
- idp_slo_target_url: "<YOUR SSO logout URL>"
-
- # Attribute map in SAML
- attribute_statements:
- # What attribute in SAML maps to email (default: mail)
- email: ['mail']
- # What attribute in SAML maps to the user login (default: uid)
- login: ['uid']
- # What attribute in SAML maps to the first name (default: givenName)
- first_name: ['givenName']
- # What attribute in SAML maps to the last name (default: sn)
- last_name: ['sn']
-
- # OPTIONAL: Additional SAML provider(s)
- #mysaml2:
- # name: "saml2"
- # display_name: "Additional SSO"
- # (...)
- #mysaml3:
- # (...)
-```
-
-Be sure to choose the correct indentation and base key. The items below the `saml` key should be indented two spaces more than `saml` already is. And `saml` can will need to be placed in the `default` or `production` group so it will already be indented. You will get an YAML parsing error otherwise when trying to start OpenProject.
-
-#### 1.2 Environment variables
+#### 1.1 Environment variables
As with [all the rest of the OpenProject configuration settings](../../../installation-and-operations/configuration/environment/), the SAML configuration can be provided via environment variables.
-E.g.
+Example
```bash
# Name of the provider, leave this at saml unless you use multiple providers
@@ -167,7 +96,7 @@ OPENPROJECT_SAML_SAML_ATTRIBUTE__STATEMENTS_LAST__NAME="[sn]"
Please note that every underscore (`_`) in the original configuration key has to be replaced by a duplicate underscore
(`__`) in the environment variable as the single underscore denotes namespaces. For more information, follow our [guide on environment variables](../../../installation-and-operations/configuration/environment/).
-#### 1.3 Settings in database
+#### 1.2 Settings in database
The SAML settings can also be changed at runtime in the database through the OpenProject settings.
As opposed to other settings there is no user interface for this.
@@ -184,7 +113,7 @@ That means it's best to set them using the console.
> docker-compose run --rm web bundle exec rails console
```
-Once on the console you can set the same values as named in the `configuration.yml` file, however they need to be nested within a 'providers' key as follows.
+Once on the console you can set the same values as named in the ENV environment file, however they need to be nested within a 'providers' key as follows.
For example:
```ruby
@@ -227,45 +156,100 @@ Setting.plugin_openproject_auth_saml = Hash(Setting.plugin_openproject_auth_saml
})
```
-### 2. Configuration details
-In this section, we detail some of the required and optional configuration options for SAML.
+#### 1.3 config/configuration.yml file
-**Mandatory: Response signature verification**
-
-SAML responses by identity providers are required to be signed. You can configure this by either specifying the response's certificate fingerprint in `idp_cert_fingerprint` , or by passing the entire PEM-encoded certificate string in `idp_cert` (beware of newlines and formatting the cert, [c.f. the idP certificate options in omniauth-saml](https://github.com/omniauth/omniauth-saml#options))
-
+> **NOTE**: ONLY for OpenProject version 11 and older
+In your OpenProject packaged installation, you can modify the `/opt/openproject/config/configuration.yml` file.
+Edit the file in your favorite editor
-**Mandatory: Attribute mapping**
+```
+vim /opt/openproject/config/configuration.yml
+```
-Use the key `attribute_statements` to provide mappings for attributes returned by the SAML identity provider's response to OpenProject internal attributes.
+This will contains the complete OpenProject configuration and can be extended to also contain metadata settings and connection details for your SSO identity provider.
-**a) Attribute mapping example for configration.yml**
+The following is an exemplary file with a set of common settings:
```yaml
default:
# <-- other configuration -->
- mysaml1:
- # <-- other configuration -->
+ saml:
+ # First SAML provider
+ mysaml1:
+ # Name of the provider, leave this at saml unless you use multiple providers
+ name: "saml"
+ # The name that will be display in the login button
+ display_name: "My SSO"
+ # Use the default SAML icon
+ icon: "auth_provider-saml.png"
+
+ # The callback within OpenProject that your idP should redirect to
+ assertion_consumer_service_url: "https://<YOUR OPENPROJECT HOSTNAME>/auth/saml/callback"
+ # The SAML issuer string that OpenProject will call your idP with
+ issuer: "https://<YOUR OPENPROJECT HOSTNAME>"
+
+ # IF your SSL certificate on your SSO is not trusted on this machine, you need to add it here in ONE line
+ ### one liner to generate certificate in ONE line
+ ### awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <yourcert.pem>
+ #idp_cert: "-----BEGIN CERTIFICATE-----\n ..... SSL CERTIFICATE HERE ...-----END CERTIFICATE-----\n"
+ # Otherwise, the certificate fingerprint must be added
+ # Either `idp_cert` or `idp_cert_fingerprint` must be present!
+ idp_cert_fingerprint: "E7:91:B2:E1:..."
+
+ # Replace with your SAML 2.0 redirect flow single sign on URL
+ # For example: "https://sso.example.com/saml/singleSignOn"
+ idp_sso_target_url: "<YOUR SSO URL>"
+ # Replace with your redirect flow single sign out URL
+ # or comment out
+ # For example: "https://sso.example.com/saml/proxySingleLogout"
+ idp_slo_target_url: "<YOUR SSO logout URL>"
+
# Attribute map in SAML
attribute_statements:
- # Use the `mail` attribute for
+ # What attribute in SAML maps to email (default: mail)
email: ['mail']
- # Use the mail address as login
- login: ['mail']
+ # What attribute in SAML maps to the user login (default: uid)
+ login: ['uid']
# What attribute in SAML maps to the first name (default: givenName)
first_name: ['givenName']
# What attribute in SAML maps to the last name (default: sn)
last_name: ['sn']
+
+ # OPTIONAL: Additional SAML provider(s)
+ #mysaml2:
+ # name: "saml2"
+ # display_name: "Additional SSO"
+ # (...)
+ #mysaml3:
+ # (...)
```
+Be sure to choose the correct indentation and base key. The items below the `saml` key should be indented two spaces more than `saml` already is. And `saml` can will need to be placed in the `default` or `production` group so it will already be indented. You will get an YAML parsing error otherwise when trying to start OpenProject.
+
+####
+
+### 2. Configuration details
+
+In this section, we detail some of the required and optional configuration options for SAML.
+
+**Mandatory: Response signature verification**
+
+SAML responses by identity providers are required to be signed. You can configure this by either specifying the response's certificate fingerprint in `idp_cert_fingerprint` , or by passing the entire PEM-encoded certificate string in `idp_cert` (beware of newlines and formatting the cert, [c.f. the idP certificate options in omniauth-saml](https://github.com/omniauth/omniauth-saml#options))
+
+
+
+**Mandatory: Attribute mapping**
+
+Use the key `attribute_statements` to provide mappings for attributes returned by the SAML identity provider's response to OpenProject internal attributes.
+
You may provide attribute names or namespace URIs as follows: `email: ['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress']`.
The OpenProject username is taken by default from the `email` attribute if no explicit login attribute is present.
-**b) Attribute mapping example for database**
+**a) Attribute mapping example for database**
```ruby
Setting.plugin_openproject_auth_saml = Hash(Setting.plugin_openproject_auth_saml).deep_merge({
@@ -288,7 +272,26 @@ Setting.plugin_openproject_auth_saml = Hash(Setting.plugin_openproject_auth_saml
})
```
+**b) Attribute mapping example for configuration.yml**
+
+> **NOTE**: ONLY for OpenProject version 11 and older
+```yaml
+default:
+ # <-- other configuration -->
+ mysaml1:
+ # <-- other configuration -->
+ # Attribute map in SAML
+ attribute_statements:
+ # Use the `mail` attribute for
+ email: ['mail']
+ # Use the mail address as login
+ login: ['mail']
+ # What attribute in SAML maps to the first name (default: givenName)
+ first_name: ['givenName']
+ # What attribute in SAML maps to the last name (default: sn)
+ last_name: ['sn']
+```
**Optional: Setting the attribute format**
@@ -297,6 +300,8 @@ That means the response should contain attribute names 'mail', etc. as configure
If you have URN or OID attribute identifiers, you can modify the request as follows:
+> **NOTE**: Example is ONLY for OpenProject version 11 and older and needs to be redesigned for ENV configuration
+
```yaml
default:
# <-- other configuration -->
@@ -330,6 +335,8 @@ Your identity provider may optionally encrypt the assertion response, however no
To configure assertion encryption, you need to provide the certificate to send in the request and private key to decrypt the response:
+> **NOTE**: Example is ONLY for OpenProject version 11 and older and needs to be redesigned for ENV configuration
+
```yaml
default:
# <-- other configuration -->
@@ -343,6 +350,8 @@ Request signing means that the service provider (OpenProject in this case) uses
To enable request signing, enable the following flag:
+> **NOTE**: Example is ONLY for OpenProject version 11 and older and needs to be redesigned for ENV configuration
+
```yaml
default:
# <-- other configuration -->
@@ -541,12 +550,10 @@ Then, existing users should be able to log in using their SAML identity. Note th
**Q: Could the users be automatically logged in to OpenProject if they are already authenticated at the SAML Identity Provider?**
-A: You are able to chose a default direct-login-provider in the `/opt/openproject/config/configuration.yml` or by using environment variables
+A: You are able to chose a default direct-login-provider in the by using environment variables
```yaml
-default:
- # <-- other configuration -->
- omniauth_direct_login_provider: saml
+OPENPROJECT_OMNIAUTH__DIRECT__LOGIN__PROVIDER="saml"
```
[Read more](../../../installation-and-operations/configuration/#omniauth-direct-login-provider)