I have a fix related to the error handling that happens here: to show a proper 
error page instead of a weird 301 error, when there is an error on `/auth`.  It 
is committed on `db/7787`


---

** [tickets:#7787] Ldap error when logging in with unicode in username or 
password**

**Status:** open
**Milestone:** unreleased
**Labels:** sf-current sf-1 
**Created:** Thu Oct 30, 2014 07:54 PM UTC by Dave Brondsema
**Last Updated:** Tue Nov 18, 2014 12:50 AM UTC
**Owner:** nobody

The following error occurs with unicode in username or in password fields.

Since most LDAP systems aren't going to allow unicode usernames, I think its 
best to catch this situation ahead of time and provide a relevant error 
message, so the user can fix their input.  Note that the unicode char may even 
be a hidden left-to-right marker for example, so an explicit message about 
unicode or non-ascii may be helpful.

For password, we should handle it.  (The password change form lets you change 
it to unicode successfully)

~~~~
File '/home/dbrondsema/dbrondsema-1019/forge/Allura/allura/lib/plugin.py', line 
578 in _validate_password
  con = ldap_conn(ldap_user, password)
File '/home/dbrondsema/dbrondsema-1019/forge/Allura/allura/lib/plugin.py', line 
427 in ldap_conn
  cred or config['auth.ldap.admin_password'])
File 
'/var/local/env-allura/lib/python2.7/site-packages/TimerMiddleware-0.4.4-py2.7.egg/timermiddleware/__init__.py',
 line 117 in wrapper
  return self.run_and_log(func, inst, *args, **kwargs)
File 
'/var/local/env-allura/lib/python2.7/site-packages/TimerMiddleware-0.4.4-py2.7.egg/timermiddleware/__init__.py',
 line 126 in run_and_log
  return func(*args, **kwargs)
File 
'/var/local/env-allura/lib/python2.7/site-packages/python_ldap-2.4.14-py2.7-linux-x86_64.egg/ldap/ldapobject.py',
 line 222 in bind_s
  msgid = self.bind(who,cred,method)
File 
'/var/local/env-allura/lib/python2.7/site-packages/python_ldap-2.4.14-py2.7-linux-x86_64.egg/ldap/ldapobject.py',
 line 216 in bind
  return self.simple_bind(who,cred)
File 
'/var/local/env-allura/lib/python2.7/site-packages/python_ldap-2.4.14-py2.7-linux-x86_64.egg/ldap/ldapobject.py',
 line 201 in simple_bind
  return 
self._ldap_call(self._l.simple_bind,who,cred,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
File 
'/var/local/env-allura/lib/python2.7/site-packages/python_ldap-2.4.14-py2.7-linux-x86_64.egg/ldap/ldapobject.py',
 line 99 in _ldap_call
  result = func(*args,**kwargs)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-6: 
ordinal not in range(128)
~~~~


---

Sent from forge-allura.apache.org because [email protected] is subscribed 
to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.

Reply via email to