Bug 55570 - 92univention-management-console-web-server.inst does not register a Keycloak client correctly on initial join
92univention-management-console-web-server.inst does not register a Keycloak ...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Keycloak
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Julia Bremer
Dirk Wiesenthal
:
: 55509 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-16 09:03 CET by Dirk Wiesenthal
Modified: 2023-02-01 17:24 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.091
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2023-01-16 09:03:58 CET
The line

univention-keycloak "$@" saml/sp create --metadata-url="https://$hostname.$domainname/univention/saml/metadata" --umc-uid-mapper

does not work during initial join. Problem is
SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"

which seems to originate from not restarting the apache2 earlier. A new certificate is used during the join and this is not yet loaded by Apache.

/etc/init.d/apache2 reload

is done but this is not sufficient and too late in the script anyway.

While at it, we could also remove the explicit init.d call?

And we should double check

--metadata-url="https://$hostname.$domainname/univention/saml/metadata

when for SimpleSamlPHP

Identifier="https://$fqdn/univention/saml/metadata

is used. May become a problem, too?
Comment 1 Dirk Wiesenthal univentionstaff 2023-01-16 09:09:15 CET
For reference, to test this, run system-setup for a to-be-joined system up to the "finish" dialog, login via SSH to that machine and add the following lines to /etc/apt/sources.list

deb [trusted=yes] http://omar.knut.univention.de/build2/ ucs_5.0-0-errata5.0-2/all/
deb [trusted=yes] http://omar.knut.univention.de/build2/ ucs_5.0-0-errata5.0-2/$(ARCH)/
deb http://updates.knut.univention.de/ ucs502 main
deb http://updates.knut.univention.de/ errata502 main

Then install all package updates. And then proceed with system-setup
Comment 3 Julia Bremer univentionstaff 2023-01-28 21:55:32 CET
6d38273cad Bug #55570: yaml
2083606acd Bug #55570: Restart apache2 before trying to register keycloak client


Successful build
Package: univention-management-console
Version: 12.0.13-6A~5.0.0.202301282150
Branch: ucs_5.0-0
Scope: errata5.0-2

the apache2 service is now restarted before the univention-keycloak client registration.
Comment 4 Julia Bremer univentionstaff 2023-01-28 23:58:19 CET
a3b722b724 (HEAD -> 5.0-2, origin/5.0-2) Bug #55570: yaml
f4690ada52 Bug #55570: Download metadata even if UCR umc/saml/idp-server has been set in ldap/force layer

For keycloak usage, we recommend to create a UCR policy that sets umc/saml/idp-server to keycloak. The join then fails.

When an UCR policy is set for umc/saml/idp-server the join fails because the joinscript removes the metadata, sets the UCR variable and expects the metadata to be downloaded again by the UCR module setup_saml_sp.py.
This doesn't happen if the UCR variable has been set in an "upper" layer, e.g the ldap layer.
I now call the setup script directly in the joinscript if the metadata has not been downloaded by the ucr set.
Comment 5 Dirk Wiesenthal univentionstaff 2023-01-30 11:50:28 CET
*** Bug 55509 has been marked as a duplicate of this bug. ***
Comment 6 Dirk Wiesenthal univentionstaff 2023-01-30 14:18:47 CET
OK: Setup + Join
OK: Code
OK: YAML