Ticket #6107 (closed Bug: worksforme)
Unicode Decode Error when authenticating against Active Directory.
| Reported by: | blentz | Owned by: | wichert |
|---|---|---|---|
| Priority: | major | Milestone: | 2.5.3 |
| Component: | Users/Groups | Keywords: | unicode decode |
| Cc: |
Description
Hello, I'm trying to get Plone to authenticate against our Active Directory server.
However, I'm getting a Unicode Decode Error.
I can authenticate just fine with a non-AD user account using the exact same password.
I filed a bug with the LDAPMultiPlugins maintainer, but he's said that the backtrace doesn't show any of his product's code in it.
My Setup:
- CentOS 4.4
- Python 2.3.6
- Python-ldap 2.2.1
- Zope 2.8.8
- Plone 2.5.2
- LDAPUserFolder 2_7
- LDAPMultiPlugins 1_4
Backtrace:
2007-02-07T12:03:21 ERROR Zope.SiteErrorLog http://machine.name.removed:8080/cardomain_portal/login_form Traceback (most recent call last):
File "/usr/lib/zope/lib/python/ZPublisher/Publish.py", line 114, in publish
request, bind=1)
File "/usr/lib/zope/lib/python/ZPublisher/mapply.py", line 88, in mapply
if debug is not None: return debug(object,args,context)
File "/usr/lib/zope/lib/python/ZPublisher/Publish.py", line 40, in call_object
result=apply(object,args) # Type s<cr> to step into published object.
File "/var/lib/zope/Products/CMFFormController/FSControllerPageTemplate.py", line 90, in call
return self._call(FSControllerPageTemplate.inheritedAttribute('call'), *args, kwargs)
File "/var/lib/zope/Products/CMFFormController/BaseControllerPageTemplate.py", line 28, in _call
return self.getNext(controller_state, REQUEST)
File "/var/lib/zope/Products/CMFFormController/ControllerBase.py", line 232, in getNext
return next_action.getAction()(controller_state)
File "/var/lib/zope/Products/CMFFormController/Actions/TraverseTo.py", line 38, in call
REQUEST, bind=1)
File "/usr/lib/zope/lib/python/ZPublisher/mapply.py", line 88, in mapply
if debug is not None: return debug(object,args,context)
File "/usr/lib/zope/lib/python/ZPublisher/Publish.py", line 40, in call_object
result=apply(object,args) # Type s<cr> to step into published object.
File "/var/lib/zope/Products/CMFFormController/FSControllerPythonScript.py", line 104, in call
result = FSControllerPythonScript.inheritedAttribute('call')(self, *args, kwargs)
File "/var/lib/zope/Products/CMFFormController/Script.py", line 145, in call
return BaseFSPythonScript.call(self, *args, kw)
File "/var/lib/zope/Products/CMFCore/FSPythonScript.py", line 108, in call
return Script.call(self, *args, kw)
File "/usr/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py", line 311, in call
return self._bindAndExec(args, kw, None)
File "/usr/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py", line 348, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/var/lib/zope/Products/CMFCore/FSPythonScript.py", line 164, in _exec
result = f(*args, kw)
File "Script (Python)", line 28, in logged_in File "/var/lib/zope/Products/PlonePAS/tools/membership.py", line 299, in createMemberarea
_createObjectByType(self.memberarea_type, members, id=safe_member_id)
File "/var/lib/zope/Products/CMFPlone/utils.py", line 366, in _createObjectByType
m(id, *args, kw)
File "<string>", line 4, in addATFolder File "/usr/lib/zope/lib/python/Products/BTreeFolder2/BTreeFolder2.py", line 431, in _setObject
object.manage_afterAdd(object, self)
File "/var/lib/zope/Products/ATContentTypes/content/folder.py", line 77, in manage_afterAdd
ATCTOrderedFolder.manage_afterAdd(self, item, container)
File "/var/lib/zope/Products/Archetypes/BaseFolder.py", line 88, in manage_afterAdd
CatalogMultiplex.manage_afterAdd(self, item, container)
File "/var/lib/zope/Products/CMFCore/CMFCatalogAware.py", line 202, in manage_afterAdd
self.indexObject()
File "/var/lib/zope/Products/Archetypes/CatalogMultiplex.py", line 36, in indexObject
c.catalog_object(self, url)
File "/var/lib/zope/Products/CMFPlone/CatalogTool.py", line 357, in catalog_object
update_metadata, pghandler=pghandler)
File "/usr/lib/zope/lib/python/Products/ZCatalog/ZCatalog.py", line 567, in catalog_object
update_metadata=update_metadata)
File "/usr/lib/zope/lib/python/Products/ZCatalog/Catalog.py", line 339, in catalogObject
index = self.updateMetadata(object, uid)
File "/usr/lib/zope/lib/python/Products/ZCatalog/Catalog.py", line 277, in updateMetadata
newDataRecord = self.recordify(object)
File "/usr/lib/zope/lib/python/Products/ZCatalog/Catalog.py", line 417, in recordify
if(attr is not MV and safe_callable(attr)): attr=attr()
File "/var/lib/zope/Products/Archetypes/ExtensibleMetadata.py", line 573, in Creator
creators = self.listCreators()
File "/var/lib/zope/Products/Archetypes/ExtensibleMetadata.py", line 563, in listCreators
creators.set(self, (owner_id,))
File "/var/lib/zope/Products/Archetypes/Field.py", line 1365, in set
value = [decode(v.strip(), instance, kwargs)
File "/var/lib/zope/Products/Archetypes/Field.py", line 137, in decode
value = unicode(value, encoding)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb3 in position 8: unexpected code byte
Change History
comment:1 Changed 5 years ago by hannosch
- Owner changed from somebody to wichert
- Component changed from Unknown to Users/Groups
- Milestone changed from 2.5.3 to 2.5.x
comment:2 in reply to: ↑ description Changed 5 years ago by salmacis
Replying to blentz:
Hello, I'm trying to get Plone to authenticate against our Active Directory server.
However, I'm getting a Unicode Decode Error.
I can authenticate just fine with a non-AD user account using the exact same password.
... UnicodeDecodeError: 'utf8' codec can't decode byte 0xb3 in position 8: unexpected code byte
We had the same error here. Navigate to your acl_users in the ZMI, click on your AD Plugin, then click on the Contents tab, and click on the contained LDAPUserFolder: There you need to change the User ID Attribute: e.g. to sAMAccountName or whatever you want to be displayed when the user is logged in. By default this is set to the objectGUID which can't be decoded properly.
For groups to be correctly working, you should also consider changing groupid_attr (Properties tab of your AD plugin) to name.
If this helps, please close this ticket.
