Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kerberos auth possible problem with umlaut #332

Open
erSitzt opened this issue Nov 14, 2013 · 10 comments
Open

Kerberos auth possible problem with umlaut #332

erSitzt opened this issue Nov 14, 2013 · 10 comments

Comments

@erSitzt
Copy link

erSitzt commented Nov 14, 2013

My username in our active directory is dennis_bühring and it seems this is causing problems.

[W 131114 09:44:06 web:1635] 401 GET /auth?next=%2F (172.26.14.115) 0.91ms
[D 131114 09:44:06 authentication:457] KerberosAuthHandler user: dennis_bü[email protected]
[D 131114 09:44:06 authentication:147] user_login(dennis_bü[email protected])
[E 131114 09:44:06 web:1228] Uncaught exception GET /auth?next=%2F (172.26.14.115)
HTTPRequest(protocol='https', host='srv-gateone.bla.blub.de', method='GET', uri='/auth?next=%2F', version='HTTP/1.1', remote_ip='172.26.14.115', headers={'Connection': 'keep-alive', 'Accept-Language': 'de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4', 'Accept-Encoding': 'gzip,deflate,sdch', 'Authorization': 'Negotiate YIIIDAYGKwYBBQUCoIIIADCCB/ygMDAuBgkqhkiC9xIBAgIGCSqGSIb3EgECAgYKKwYBBAGCNwICHgYKKwYBBAGCNwICCqKCB8YEggfCYIIHvgYJKoZIhvcSAQICAQBuggetMIIHqaADAgEFoQMCAQ6iBwMFACAAAACjggYkYYIGIDCCBhygAwIBBaEUGxJaRU5UUkFMRS5FWFBFUlQuREWiMTAvoAMCAQKhKDAmGwRIVFRQGx5zcnYtZ2F0ZW9uZS56ZW50cmFsZS5leHBlcnQuZGWjggXKMIIFxqADAgEXoQMCAQKiggW4BIIFtNDkvsDeIJi9B2j/Gu36i+qfHLFLCwKLecjlZBUpkobJOUSteeFHSKVz53I2XBrEiWkZtf954gwul/thLIQ9A+9f8SF8vWqf4bzgGsPvO0bYzP7jBmUes9Hc+3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y1pKd3LbUs0L5l1HUz47cXcc9ml8ddwHSb5cIjI6aWqhvMPjn3uUnNaG8r5rI7nrYwfwEhx4YLh7HMw6XPyZhkFRX8sdQjiqVGS4Sr1VQbIF6rAKG5h2LntjWQKcTLGYUQi7h181lQXU3X0T1fQPlr3SckqDC0f', 'Host': 'srv-gateone.bla.blub.de', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.48 Safari/537.36'})
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1115, in _stack_context_handle_exception
raise_exc_info((type, value, traceback))
File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1298, in wrapper
result = method(self, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/auth/authentication.py", line 450, in get
self.get_authenticated_user(self._on_auth)
File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/auth/sso.py", line 151, in get_authenticated_user
self.auth_negotiate(auth_header, callback)
File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/auth/sso.py", line 181, in auth_negotiate
callback(user)
File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/auth/authentication.py", line 460, in _on_auth
self.user_login(user)
File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/auth/authentication.py", line 150, in user_login
user_dir = os.path.join(self.settings['user_dir'], user['upn'])
File "/usr/lib/python2.7/posixpath.py", line 80, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128)
[E 131114 09:44:06 web:1635] 500 GET /auth?next=%2F (172.26.14.115) 24.53ms
[W 131114 09:44:06 web:1635] 404 GET /favicon.ico (172.26.14.115) 17.35ms

@liftoff
Copy link
Owner

liftoff commented Nov 14, 2013

I'm having trouble reproducing this error. Can you paste the output of the locale command on the Gate One server?

Also, what OS are you using?

@liftoff
Copy link
Owner

liftoff commented Nov 14, 2013

OK I did some research and I believe I've figured out the problem: Your locale is set to something that doesn't support Unicode characters. So when Gate One tries to create your user directory (e.g. /var/lib/gateone/users/dennis_bü[email protected]) Python throws a UnicodeDecodeError exception. This is actually an expected result since your locale doesn't support non-ascii characters.

I tried various methods of encoding/normalizing unicode characters like 'ü' but none of it worked when I forced my locale via export LANG=ascii. Googling the problem came up with lots of results like, "Tell your users to fix their locale." which actually make sense since the system itself isn't configured to handle non-ascii characters.

So please change your system locale to something that will work such as 'de_DE.UTF-8' and let me know if the problem goes away (it should). If that doesn't fix it (make sure to restart Gate One after changing your system locale) then I have to do a deeper investigation.

@erSitzt
Copy link
Author

erSitzt commented Nov 14, 2013

my locale should be correct, but i will check that when i'm back at work.

@erSitzt
Copy link
Author

erSitzt commented Nov 15, 2013

Hi,

that's my locale:

LANG=de_DE.UTF-8
LANGUAGE=de_DE
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=de_DE.UTF-8

Error is still this one (for a name starting with an 'ö'):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)

@liftoff
Copy link
Owner

liftoff commented Nov 15, 2013

OK, then I'm at a loss as to what's causing your problem. I'll see if I can replicate your locale/username locally to try to reproduce this issue.

In the mean time can you do me a favor and paste the output of this command?

python -c 'import sys; print(sys.getfilesystemencoding())'

On my system that gives:

root@enterprise:~ # python -c 'import sys; print(sys.getfilesystemencoding())'
UTF-8

@liftoff
Copy link
Owner

liftoff commented Nov 16, 2013

I was just able to reproduce this! A fix will be committed soon.

liftoff added a commit that referenced this issue Nov 16, 2013
…would throw Unicode*Error exceptions. This should close issue #332 (#332).

ssh_connect.py:  Fixed a bug where you could get encoding-related exceptions if a user's UPN contained unicode characters.
utils.py:  Fixed a bug in `cmd_var_swap()` where you could get encoding-related exceptions if one of the swapped variables contained unicode characters.
termio.py:  Fixed a bug where you could get encoding-related exceptions if an environment variable contained unicode characters.
@liftoff
Copy link
Owner

liftoff commented Nov 16, 2013

I just pushed a commit that should fix this. I actually had to fix a number of Unicode*Error exceptions that I somehow missed over the past few weeks (months?). Here's proof that it works:

[I 131115 20:58:07 server:2266] User dennis_bühring@enterprise authenticated successfully via origin enterprise.example.com (location: default).

I made a user named, "dennis_bühring" on my system just to test this 😄

Please pull the latest code and let me know if it is working, thanks!

@erSitzt
Copy link
Author

erSitzt commented Nov 16, 2013

Sweet :)
I can check on monday and confirm if its working ! Thanks !

@erSitzt
Copy link
Author

erSitzt commented Nov 20, 2013

I think the GateOne part is ok now, but i'm still having problems authenticating users with umlauts.
But that might a problem with by kerberos config i haven't figured out yet.

@liftoff
Copy link
Owner

liftoff commented Nov 21, 2013

Well if you're getting errors in the Gate One logs post them. I may have missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants