Repository navigation
Description
We need to find out if we can re-configure keystone without downtime to serve additional per customer endpoints for federation.
The endpoints look like this for OIDC (containing <CUSTOMERREALM> in OIDCDiscoverURL):
<LocationMatch /v3/auth/OS-FEDERATION/identity_providers/<IDPNAME>/protocols/openid/websso>
OIDCDiscoverURL https://api.testbed.osism.xyz:5000/redirect_uri?iss=https%3A//keycloak.testbed.osism.xyz/auth/realms/<CUSTOMERREALM>
Require valid-user
AuthType openid-connect
</LocationMatch>
and like this for plain OAuth 2.0 (containing <CUSTOMERREALM> in OAuth2TokenVerify):
<LocationMatch /v3/OS-FEDERATION/identity_providers/<IDPNAME>/protocols/openid/auth>
Require valid-user
AuthType oauth2
OIDCUnAuthAction pass
OAuth2TokenVerify jwks_uri https://keycloak.testbed.osism.xyz/auth/realms/<CUSTOMERREALM>/protocol/openid-connect/certs jwks_uri.ssl_verify=false
OAuth2TargetPass prefix=OIDC-
</LocationMatch>
We currently have only a single global
OIDCProviderMetadataURL https://keycloak.testbed.osism.xyz/auth/realms/<CUSTOMERREALM>/.well-known/openid-configuration
for the whole keystone. Maybe we need:
- https://github.com/OpenIDC/mod_auth_openidc/wiki/Multiple-Providers
- https://github.com/OpenIDC/mod_auth_openidc/wiki#12-how-can-i-customize-the-idp-discovery-or-initial-login-page
- Trying to implement multiple providers with OIDCDiscoverURL and LocationMatch OpenIDC/mod_auth_openidc#745
Context
The larger user story here is:
As a SCS operator, I want be able to onboard an additional SCS customer so that OIDC can be used to federate from Keystone to the SCS internal IdP. From there it shall be possible to use IdP federation to consume identities from an external, customer managed IAM.
Our current picture is that each new SCS customer will have a specific "realm" (or "organisation") in the SCS internal IdP.
There are two levels here:
- The pure technical question, if the apache2 in the keystone container can be made to reload the
wsgi-keystone.confin case new endpoints need to be added. - The broader question how we would make user experience for Login at Horizon work for an SCS operator. E.g. the user should not need to see a dropdown with the realms of all other customers of the SCS operator.
For the scope of this issue we should focus on the first point, to find out our current technical constraints and how to handle them.
Definition of Ready:
- User Story is small enough to be finished within one sprint
- User Story is clear and understood by the whole team
- Acceptance criteria are defined
- Acceptance criteria are clear and understood by the whole team
Definition of Done:
- All acceptance criteria are met
- Changes have been reviewed
- CI tests have run successfully
- Documentation has been updated
- Release Notes have been updated
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
reqa commentedon Apr 26, 2023
The keystone container runs apache with option
-DFOREGROUNDand apparently that breaks apache reloads (via apache2ctl or SIGUSR1).I tested with
and it seems more like 12 seconds than 2 in the gx-scs testbed at PS.
garloff commentedon May 17, 2023
Trying to workaround by having files that we hoped would be re-read does not work.
(Files are only reread on restart/reload.)
reqa commentedon Jun 15, 2023
Update: According to discussion in the friday hacksession we are now experimenting with the Home IdP Discovery extension for Keycloak which would shift the realm selection towards Keycloak and it would be based on email addresses (1:1 relation between realm and domain name).
JuanPTM commentedon Jun 15, 2023
Relationship is 1:N bewtween realms and domains name. Not sure about how big is the N
JuanPTM commentedon Jul 12, 2023
Once the IdP discovery extension is configure and federation is working the next problem in line is mapping the federated users into Keystone.
This is done by using a rules files in Keystone. At the moment, we can create ephemereal users but groups and roles mapping are still not working properly.
garloff commentedon Aug 9, 2023
Proxy realm has email domain to map to real realm.
Next step is to test this in testbed. Then cfg-generics.
Open: (keystone-extension)[https://github.com/sventorben/keycloak-home-idp-discovery] needed ... understand maintenance plan (AI @reqa).
reqa commentedon Aug 23, 2023
FYI: The author of keycloak-home-idp-discovery responded today with a positive reaction. The email was in german but I think it's fair to translate and sumarize as: He likes that we use the project and he wants to maintain in in a best effort way trying to be backward-compatible with Keycloak releases but promising nothing as Keycloak sometimes doesn't allow that. The author will not maintain older releases of the extension or backport features. I think that's a reasonable take.
reqa commentedon Sep 6, 2023
Information from @knikolla regarding the question where the shadow accounts are created (if mapping type is
ephemeral) or expected to exist, pre-created by external tooling (if mapping type islocal):allow specifying the domain for the user in the mapping) is connected to this Bug: https://bugs.launchpad.net/keystone/+bug/1887515From https://docs.opendev.org/opendev/infra-manual/latest/developers.html#rebasing-a-commit I learned that I could checkout that feature branch locally by running:
which then left me in a local branch called
review/rafael_weingartner/bug/1887515.JuanPTM commentedon Sep 12, 2023
I've work on configuring the plugging using the CLI.
I still not figure it out how to ship the jar. Or we haven't agree on how to ship it.
For the moment this is how to configure it using the CLI
kcadm.sh.This commands create the authentication flow to use the plugging. The only problem are that the JSON must have the id of the correspondent resource to work. Which is generated and shown after the creation of the resource.
So, maybe this should be scripting on a bash script or something.
Install IdP discovery authenticator
JuanPTM commentedon Sep 27, 2023
Created MR adding the installation of the IdP discovery jar in the playbook.
osism/testbed#1775
JuanPTM commentedon Oct 16, 2023
The objective has shifted to prepare a SCS/container-images repository to be able to build nice overlay container images.
garloff commentedon Oct 25, 2023
Done, followup work to create the overlay image.