ich habe die Migration auf Keycloak durchgeführt. Nun möchte ich das erste Service, in dem Fall Nextcloud dahingehende zum tun bewegen. Habe mich an die Doku gehalten.
Dann hab ich in der SSO Konfiguration im Webinterface Keycloak als neuen Proivder angelegt, damit die alte SAML Geschichte derweilen noch ihre Dienste tut.
Dort habe ich unter “Identifikationsmerkmal des Autorisierungsdienstes” dies eingetragen:
Wie ich den Inhalt der nächsten Zeile “URL-Ziel des an den der Dienstanbieter dei Anmeldeanfragen…” hab ich schon nicht mehr eruieren können
Beim Zertifikat hab ich das PubCA von UCS hinein kopiert. Sprich gleich wie bei Simple SamlPHP.
Wie geht man denn hier richtig vor?
Was ich auch nicht ganz kapiert habe… Die SAML Identity Provider, die bereits im UDM eingepflegt waren, sind die eigentlich noch von Belang? Weil da musst der User ja Mitglied sein, sonst funktionierte kein SAML PHP.
Hi Boospy,
ich habe genau das selbe gerade auch gemacht. Dazu gibt es bereits eine gute Anleitung unter https://docs.software-univention.de/keycloak-migration/migration-examples/saml.html#nextcloud
bei mir hat das einwandfrei funktioniert.
Allerdings ersetzt es dir dabei SimpleSAML als IDP.
Wenn du aber Keycloak als zusätzlichen IDP hinzufügen willst, dann solltest du mit den Parametern dort weiterkommen.
Dank dir @haubi das hab ich voll übersehen. Und ja, hat sofort und perfekt funktioniert.
Weist du event. was die Option “role-mapping-single-value” tut? Weil ohne der funktioniert der Login nicht, und ich konnte in der GUI so eine Option auch nicht finden…
hi boospy,
nein ich weiss nicht was das ist. Ich habe den Befehl einfach so abgeschrieben.
Ich kann dir auch nicht sagen ob die SAML Identity Provider, die bereits im UDM eingepflegt waren, noch von Belang sind. Ich hoffe das sich da sonst noch jemand dazu äussert.
Liebe Grüsse
Andy
Hi,
hab jetzt auch mal testweise auf Keycloak migriert und die Nextcloud umgestellt.
Meine Vorgehensweise war auch wie im Link oben beschrieben und hat ohne Fehler funktioniert.
Wenn ich jetzt aber versuche, mich in die Nextcloud per “Login mit UCS” einzuloggen, bekomme ich die Nextcloud-Fehlermeldung: “Dein Konto wird nicht bereitgestellt. Der Zugriff ist daher nicht möglich.”
Login über direkte Anmeldung funktioniert (auch mit dem gleichen User).
Ich hab die Einstellungen kontrolliert, aber es scheint alles zu passen.
Fehlermeldung im nextcloud.log:
{"reqId":"iO3CZbyr6xTnOaZF2wXX","level":4,"time":"2024-04-21T15:24:25+00:00","remoteAddr":"192.168.24.x","user":"--","app":"user_saml","method":"POST","url":"/nextcloud/apps/user_saml/saml/acs","message":"**IDP parameter for the UID not found. Possible parameters are: []**","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"27.1.6.2","data":{"app":"user_saml"}}
Auf deine Fehlermeldung hab ich jetzt auf der Stelle zwar keine Antwort, Aber ich da einiges nochmal zusammen gefasst. Vielleicht siehst hier noch etwas was noch getan werden muss:
Hi @hpz
now I see what you are talking about… I’ve been finally trying to integrate UCS Keycloak with a “standalone” Nextcloud, and I have a hell of a time figuring this out.
IDP parameter for the UID not found. Possible parameters are: []
I tried changing the Nextcloud SSO app “Attribute to map the UID to.” to various things. Played with Keycloak “Client-scopes → role_list” all to non avail.
No, unfortunately not.
The system is not that important so my time (and motivation) to fix it out was limited.
With every update, I hope that the problem has solved itself: Unsuccessful to date
I think I might be getting somewhere. So the guide by @boospy mentiones: univention-keycloak saml/sp create --metadata-url="https://nextcloud.domain/index.php/apps/user_saml/saml/metadata" --role-mapping-single-value
I removed my initial Client entry (which I created in the Keycloak GUI) and recreated it with this CLI line.
Then in the Keycloak GUI added:
Valid redirect URIs
The Public X.509 cert comes from Keycloak Realm Settings → Keys → RS256 → Certificate
This finally is working, although I have some other issues with authentication due to nextcloud misconfiguration at the installation
OMG, it worked for me too!
I am able to login via saml and have no idea why it works now, because the settings are the same. I had to change the redirect URIs (delete the …index.php…) but yes. Cool, thanks alot