Bug 47241 - Configure SAML Single Sign-On as single server solution not working
Configure SAML Single Sign-On as single server solution not working
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: SAML
UCS 4.3
Other Linux
: P5 normal (vote)
: UCS 4.3-1-errata
Assigned To: Erik Damrose
Jürn Brodersen
:
: 46563 (view as bug list)
Depends on:
Blocks: 47406
  Show dependency treegraph
 
Reported: 2018-06-25 13:33 CEST by Jürn Brodersen
Modified: 2018-08-01 14:54 CEST (History)
6 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 4: A User would return the product
User Pain: 0.114
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2018062221000554
Bug group (optional): Workaround is available
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jürn Brodersen univentionstaff 2018-06-25 13:33:45 CEST
Configure SAML Single Sign-On as single server solution not working

https://help.univention.com/t/configure-saml-single-sign-on-as-single-server-solution/6681

in univention-saml.conf:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%%{HTTP:Authorization},L]

The "L" prevents further rewrites which breaks static served by apache like languages.json
Comment 1 Erik Damrose univentionstaff 2018-06-25 15:56:16 CEST
A customer reported the following workaround works in their environment: Enclose the Rewrite* Statenents at the bottom of /etc/apache2/sites-available/univention-saml.conf (or its template) with the simpplesamlphp directory, so it looks like this:

<Directory /simplesamlphp>
  RewriteEngine on
  RewriteCond %%{HTTP:Authorization}  !^$
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%%{HTTP:Authorization},L]
</Directory>
Comment 2 Stefan Gohmann univentionstaff 2018-06-26 09:29:38 CEST
I've removed the flags 'School Customer affected' and 'Enterprise Customer affected' because a ticket or a customer ID is not set.
Comment 3 Erik Damrose univentionstaff 2018-06-29 11:01:03 CEST
*** Bug 46563 has been marked as a duplicate of this bug. ***
Comment 4 Erik Damrose univentionstaff 2018-06-29 11:01:48 CEST
ba960c85 When operating without a separate VirtualHost for single sign-on, a
rewrite rule in the scope of other config rules limited execution of
further rewrite rules. This fix restricts the rewrite rule to the
single sign-on directory.

univention-saml 5.0.4-20A~4.3.0.201806291057
c6827a7 yaml
I set the yaml options to release the fix for 4.3-0 and 4.3-1. When released, we can remove the preup update blocker introduced by bug 46605
Comment 5 Jürn Brodersen univentionstaff 2018-07-04 12:34:02 CEST
/etc/apache2/sites-enabled/univention-saml.conf:42: <Directory> was not closed.
Comment 6 Erik Damrose univentionstaff 2018-07-04 13:09:46 CEST
ebc1d612 Fix typo in apache config
yaml updated
Comment 7 Quality Assurance univentionstaff 2018-07-04 16:05:18 CEST
--- mirror/ftp/4.3/unmaintained/4.3-1/source/univention-saml_5.0.4-19A~4.3.0.201805241344.dsc
+++ apt/ucs_4.3-0-errata4.3-1/source/univention-saml_5.0.4-21A~4.3.0.201807041308.dsc
@@ -1,6 +1,11 @@
-5.0.4-19A~4.3.0.201805241344 [Thu, 24 May 2018 13:44:20 +0200] Univention builddaemon <buildd@univention.de>:
+5.0.4-21A~4.3.0.201807041308 [Wed, 04 Jul 2018 13:08:29 +0200] Univention builddaemon <buildd@univention.de>:
 
   * UCS auto build. No patches were applied to the original source package
+
+5.0.4-21 [Wed, 04 Jul 2018 13:06:56 +0200] Erik Damrose <damrose@univention.de>:
+
+  * Bug #47241: Fix apache configuration when operating without a separate
+    VirtualHost for single sign-on
 
 5.0.4-19 [Thu, 24 May 2018 13:43:10 +0200] Felix Botner <botner@univention.de>:
 

<http://10.200.17.11/4.3-1/#8398688827871475628>
Comment 8 Jürn Brodersen univentionstaff 2018-07-05 11:15:42 CEST
Looks good.
But saml/idp/authsource=univention-negotiate doesn't work with this configuration for me.
Comment 9 Erik Damrose univentionstaff 2018-07-23 17:47:42 CEST
Config adapted. Only forward HTTP_AUTHORIZATION header to Location /saml-bin.

0c0be64 Fix config to allow SAML+Kerberos login
4d33ac6 yaml

Package: univention-saml
Version: 5.0.4-24A~4.3.0.201807231740

The saml+kerberos configuration has to be adapted and a new SPN for the external fqdn has to be added. Try with these steps. If it works, the SDB article https://help.univention.com/t/6681 will be extended after this feature is published

(make sure univention-negotiate is activated: ucr set saml/idp/authsource=univention-negotiate)

spn_account_name="ucs-sso"
servicePrincipalName="HTTP/$FQDN"
samba-tool spn add "$servicePrincipalName" "$spn_account_name"
spn_account_name_password=$(</etc/simplesamlphp/ucs-sso-kerberos.secret)
msdsKeyVersion=$(ldbsearch -H /var/lib/samba/private/sam.ldb \
    samAccountName="$spn_account_name" msDS-KeyVersionNumber \
    | sed -n 's/^msDS-KeyVersionNumber: \(.*\)/\1/p')

ldbmodify -H /var/lib/samba/private/secrets.ldb <<-%EOF
dn: samAccountName=$spn_account_name,CN=Principals
changetype: modify
replace: secret
secret: $spn_account_name_password
-
replace: msDS-KeyVersionNumber
msDS-KeyVersionNumber: $msdsKeyVersion
-
add: servicePrincipalName
servicePrincipalName: $servicePrincipalName
%EOF

cp /var/lib/samba/private/simplesamlphp.keytab /etc/simplesamlphp.keytab

Note: The domainname for the internal and external domain have to be equal, i.e. equal the kerberos realm. Configuring saml+kerberos in any other scenario is out of scope here
Comment 10 Jürn Brodersen univentionstaff 2018-07-30 14:37:37 CEST
What I tested
Saml with and without samba using the sdb article.

The steps in comment 9 are working for me.

Kerberos without samba isn't working with the sdb article. As discussed that is not a blocker.

-> Verified
Comment 11 Arvid Requate univentionstaff 2018-08-01 14:54:40 CEST
<http://errata.software-univention.de/ucs/4.3/159.html>