Keystone returns spurious federated users for LDAP-backed domain
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
In Progress
|
Undecided
|
Pavlo Shchelokovskyy |
Bug Description
I have the following setup:
- "ldap" domain is configured to point to LDAP instance via domain specific drivers
- I have also enabled federation via OpenIDConnect to my developer Okta.com account
$ openstack domain list
+------
| ID | Name | Enabled | Description |
+------
| 40e2fcb908e64f8
| 870037de4a514c1
| default | Default | True | The default domain |
+------
These are the users in each domain:
$ openstack user list --domain ldap
+------
| ID | Name |
+------
| 79b6059c726cb41
| 4c18fa92b731f01
| 54b404b1c0f3fae
+------
$ openstack user list --domain 870037de4a514c1
+------
| ID | Name |
+------
| 0729a3d45a8f148
+------
The mapping for federation is the following:
$ openstack mapping show openidc_mapping -f value -c rules
[{'local': [{'user': {'name': '{0}'}, 'group': {'domain': {'name': 'Default'}, 'name': 'federated_
and the group has assignments on
$ openstack role assignment list --group federated_users --names
+------
| Role | User | Group | Project | Domain | System | Inherited |
+------
| member | | federated_
+------
no mention of "ldap" domain anywhere.
What I perceive as as an issue happens when I try to show a user from federated domain
while specifying the "ldap" domain:
$ openstack user show <email address hidden> --domain ldap
+------
| Field | Value |
+------
| domain_id | 40e2fcb908e64f8
| enabled | True |
| id | 9eaa86cad8bb421
| name | <email address hidden> |
| options | {} |
| password_expires_at | None |
+------
This returns a user with spurious user ID that can not be found afterwards:
$ openstack user show 9eaa86cad8bb421
No user with a name or ID of '9eaa86cad8bb42
It seems the reason is that code decides that as LDAP driver is domain unaware
and removes domain hints too early, while these hints are being used afterwards to query the
federation provider as well:
Instead I think this check and removal of domain hints should be done later,
immediately before the actual identity driver (which may be domain unaware) is called
in "_handle_
Fix proposed to branch: master /review. opendev. org/749296
Review: https:/