Role lookup fails for Active Directory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
High
|
Brant Knudson |
Bug Description
When using Keystone against an Active Directory server, assigned roles aren't found for users.
To recreate, set up Keystone to go against Active Directory, create users and roles, then try to get a token scoped to a project as a user. It will fail with
User admin is unauthorized for tenant 3c1299e1042a400
I looked into this a bit, and it looks like the problem is that DNs aren't being compared correctly.
With Active Directory, when you add a roleOccupant, the DN gets normalized. For exmample, here I add a "cn=..." dn to an entry, but when I search to get it back, it's now "CN=..." (the attribute name has been capitalized).
$ ldapmodify <<EOF
dn: CN=8bd9f13ac6cf
add: roleOccupant
roleOccupant: cn=8bd9f13ac6cf
EOF
modifying entry "CN=8bd9f13ac6c
$ ldapsearch -LL -s base \
-b "CN=8bd9f13ac6c
"(objectcla
version: 1
dn: CN=8bd9f13ac6cf
roleOccupant: CN=8bd9f13ac6cf
d474180,ou=groups
There's suspect code in keystone/
return [self.role.
here, user_dn is like 'cn=xxx' and the result user_dn is like 'CN=xxx'
so they don't match.
Keystone needs to do DN comparisons properly, for example by normalizing.
Changed in keystone: | |
assignee: | nobody → Brant Knudson (blk-u) |
tags: | added: grizzly-backport-potential |
Changed in keystone: | |
importance: | Undecided → High |
milestone: | none → havana-3 |
Changed in keystone: | |
status: | Fix Committed → Fix Released |
Changed in keystone: | |
milestone: | havana-3 → 2013.2 |
Fix proposed to branch: master /review. openstack. org/41515
Review: https:/