Activity log for bug #1396763

Date Who What changed Old value New value Message
2014-11-26 20:20:59 Steve Martinelli bug added bug
2014-11-26 20:21:32 Steve Martinelli description In the case where the [ldap] user_id_attribute = uid Lets say a user attempts to authenticate with stevemar@example.com, and the UID returned is 01234567. The following log entries show that the leading 0 is dropped: keystone.common.ldap.core [-] LDAP search: base=o=example.com scope=2 filterstr=(&(emailAddress=stevemar@example.com)(objectClass=person)) attrs=['emailAddress', 'userPassword', 'enabled', 'uid'] attrsonly=0 search_s /opt/stack/keystone/keystone/common/ldap/core.py:926 keystone.common.ldap.core [-] LDAP unbind unbind_s /opt/stack/keystone/keystone/common/ldap/core.py:899 keystone.identity.core [-] ID Mapping - Domain ID: default, Default Driver: True, Domains: False, UUIDs: False, Compatible IDs: True _set_domain_id_and_mapping /opt/stack/keystone/keystone/identity/core.py:321 keystone.identity.core [-] Local ID: 11918649 _set_domain_id_and_mapping_for_single_ref /opt/stack/keystone/keystone/identity/core.py:339 keystone.common.ldap.core [-] LDAP init: use_tls=False tls_cacertfile=None tls_cacertdir=None tls_req_cert=2 tls_avail=1 _common_ldap_initialization /opt/stack/keystone/keystone/common/ldap/core.py:575 ** here is where the leading 0 is dropped ** keystone.common.ldap.core [-] LDAP search: base=o=example.com scope=2 filterstr=(&(uid=1234567)(objectClass=person)) attrs=['emailAddress', 'userPassword', 'enabled', 'uid'] attrsonly=0 search_s /opt/stack/keystone/keystone/common/ldap/core.py:926 keystone.common.ldap.core [-] LDAP unbind unbind_s /opt/stack/keystone/keystone/common/ldap/core.py:899 keystone.common.wsgi [-] Authorization failed. Invalid username or password (Disable debug mode to suppress these details.) The main code in question is the following in keystone.common.ldap.core.py https://github.com/openstack/keystone/blob/master/keystone/common/ldap/core.py#L110-L128 try: return LDAP_VALUES[val] except KeyError: pass try: return int(val) except ValueError: pass return utf8_decode(val) Where we attempt to convert all fields to int, and if it fails proceed to string. On a semi-related note: the PyCADF library explicitly expects user_ids to be strings, so I had to add str() to user_id in the _get_request_audit_info function, in notifications.py: initiator = resource.Resource(typeURI=taxonomy.ACCOUNT_USER, name=user_id, host=host) to initiator = resource.Resource(typeURI=taxonomy.ACCOUNT_USER, name=str(user_id), host=host) In the case where the [ldap] user_id_attribute = uid Lets say a user attempts to authenticate with stevemar@example.com, and the UID returned is 01234567. The following log entries show that the leading 0 is dropped: keystone.common.ldap.core [-] LDAP search: base=o=example.com scope=2 filterstr=(&(emailAddress=stevemar@example.com)(objectClass=person)) attrs=['emailAddress', 'userPassword', 'enabled', 'uid'] attrsonly=0 search_s /opt/stack/keystone/keystone/common/ldap/core.py:926 keystone.common.ldap.core [-] LDAP unbind unbind_s /opt/stack/keystone/keystone/common/ldap/core.py:899 keystone.identity.core [-] ID Mapping - Domain ID: default, Default Driver: True, Domains: False, UUIDs: False, Compatible IDs: True _set_domain_id_and_mapping /opt/stack/keystone/keystone/identity/core.py:321 keystone.identity.core [-] Local ID: 1234567 _set_domain_id_and_mapping_for_single_ref /opt/stack/keystone/keystone/identity/core.py:339 keystone.common.ldap.core [-] LDAP init: use_tls=False tls_cacertfile=None tls_cacertdir=None tls_req_cert=2 tls_avail=1 _common_ldap_initialization /opt/stack/keystone/keystone/common/ldap/core.py:575 ** here is where the leading 0 is dropped ** keystone.common.ldap.core [-] LDAP search: base=o=example.com scope=2 filterstr=(&(uid=1234567)(objectClass=person)) attrs=['emailAddress', 'userPassword', 'enabled', 'uid'] attrsonly=0 search_s /opt/stack/keystone/keystone/common/ldap/core.py:926 keystone.common.ldap.core [-] LDAP unbind unbind_s /opt/stack/keystone/keystone/common/ldap/core.py:899 keystone.common.wsgi [-] Authorization failed. Invalid username or password (Disable debug mode to suppress these details.) The main code in question is the following in keystone.common.ldap.core.py https://github.com/openstack/keystone/blob/master/keystone/common/ldap/core.py#L110-L128     try:         return LDAP_VALUES[val]     except KeyError:         pass     try:         return int(val)     except ValueError:         pass     return utf8_decode(val) Where we attempt to convert all fields to int, and if it fails proceed to string. On a semi-related note: the PyCADF library explicitly expects user_ids to be strings, so I had to add str() to user_id in the _get_request_audit_info function, in notifications.py:   initiator = resource.Resource(typeURI=taxonomy.ACCOUNT_USER, name=user_id, host=host)     to   initiator = resource.Resource(typeURI=taxonomy.ACCOUNT_USER, name=str(user_id), host=host)
2014-11-26 20:22:05 Steve Martinelli keystone: status New Confirmed
2014-11-26 20:22:32 Steve Martinelli keystone: importance Undecided High
2014-11-26 21:53:54 OpenStack Infra keystone: status Confirmed In Progress
2014-11-26 21:53:54 OpenStack Infra keystone: assignee Steve Martinelli (stevemar)
2014-12-08 14:45:29 Adam Young nominated for series keystone/icehouse
2014-12-08 14:45:29 Adam Young bug task added keystone/icehouse
2014-12-08 14:45:29 Adam Young nominated for series keystone/kilo
2014-12-08 14:45:29 Adam Young bug task added keystone/kilo
2014-12-08 14:45:29 Adam Young nominated for series keystone/juno
2014-12-08 14:45:29 Adam Young bug task added keystone/juno
2014-12-08 23:45:05 OpenStack Infra keystone: status In Progress Fix Committed
2014-12-16 00:24:21 Morgan Fainberg keystone/kilo: milestone kilo-1
2014-12-17 08:09:09 Thierry Carrez keystone: status Fix Committed Fix Released
2015-01-24 03:21:41 OpenStack Infra keystone/juno: status New In Progress
2015-01-24 03:21:41 OpenStack Infra keystone/juno: assignee Richard Megginson (rmeggins)
2015-01-28 22:19:23 OpenStack Infra keystone/juno: status In Progress Fix Committed
2015-01-29 15:02:21 Chuck Short keystone/juno: milestone 2014.2.2
2015-02-05 15:07:44 Chuck Short keystone/juno: status Fix Committed Fix Released
2015-04-04 00:27:51 Morgan Fainberg keystone/juno: importance Undecided High
2015-04-04 00:27:55 Morgan Fainberg keystone/icehouse: importance Undecided High
2015-04-04 00:28:02 Morgan Fainberg keystone/icehouse: status New Triaged
2015-04-30 08:01:40 Thierry Carrez keystone: milestone kilo-1 2015.1.0
2015-04-30 08:19:18 Thierry Carrez bug task deleted keystone/kilo
2015-09-24 20:51:17 Morgan Fainberg keystone/icehouse: status Triaged Won't Fix