bhdouglass / uappexplorer

Moved to GitLab
https://gitlab.com/bhdouglass/uappexplorer
GNU General Public License v3.0
42 stars 5 forks source link

Login leads me a broken link if full name contains Unicode letters #89

Closed sneetsher closed 7 years ago

sneetsher commented 7 years ago

This how I produce the issue:

  1. Open the main page

  2. Login

    This page comes: https://uappexplorer.com/auth/ubuntu/return

    The page you are trying to access does not exist Return to the main page

  3. Click on main page link, takes me to main page but I'm still not logged in

bhdouglass commented 7 years ago

Just to verify, as part of the login process you are redirected to Ubuntu One and login there?

sneetsher commented 7 years ago

Yes, i login to Ubuntu One when it comes back, I get that return page.

bhdouglass commented 7 years ago

Interesting, what browser are you using? I can't seem to get this situation to happen.

sneetsher commented 7 years ago

hmm I've Firefox v53 64bit, Ubuntu 16.04, uBlock was active and blocks only one item:

https://www.google-analytics.com/analytics.js

I disabled ublock, but still same results. I tried chromium too.

bhdouglass commented 7 years ago

Did you try running it without ublock?

sneetsher commented 7 years ago

Yeah, I disabled ublock completely but still have same behavior. Also I tried Chromium and same page comes.

Probably something related to my connection: my location (IP could be blacklisted in some servers).

Here is the export of firefox debug info for that replay: Archive 17-04-29 14-11-21.har.zip

sneetsher commented 7 years ago

Yeah, I disabled ublock completely but still have same behavior. Also I tried Chromium and same page comes.

Probably something related to my connection: my location (IP could be blacklisted in some servers). However, I tried with a proxy but still same result, not found return page.

Here is the export of firefox debug info for that replay: Archive 17-04-29 14-11-21.har.zip

bhdouglass commented 7 years ago

Thanks for the debug info, I'll look into it and see what I can find.

sneetsher commented 7 years ago

@bhdouglass , I'm using Arabic letters in my full name for Ubuntu/LP account, so if the site does not expect Unicode then the issue could raise while handling it.

bhdouglass commented 7 years ago

Ok, so I think I fixed it. I'm not sure why it is happening, although it could be because of the Unicode characters in your name. Can you try it out and let me know if it works?

sneetsher commented 7 years ago

Not working yet, but it has different behavior:

sneetsher commented 7 years ago

I just confirmed that the issue is with Unicode.

I'm not familiar with nodejs & openid , but Does openid encode Unicode letters (not in ASCII subset)? Like URL encoding %XX or \uxxxx. If yes, then nodejs should decode it.

bhdouglass commented 7 years ago

Progress! So that confirms that the problem is the Unicode characters. Ubuntu is sending a POST request because of the Unicode characters (normally it's doing a GET request). Do you mind sharing a few of the Unicode characters from your name? That'll make it easier to reproduce the problem.

sneetsher commented 7 years ago

Sure:

شلي (Chelli)

Arabic has a right-to-left cursive script, you may not get same shape if not supported but you should see at least these letters ش,ل,ي .

bhdouglass commented 7 years ago

So I was able to use your name to login to uApp Explorer, it seems the POST request worked. But since your keep getting a redirect loop can you try logging out of both uApp Explorer and Ubuntu and possibly clear out any cookies involved with both sites? Let me know if that works.

sneetsher commented 7 years ago

Nice I could login but not with my complete name :). I use a long name (origin+latin):

عبدالله شلي (Abdellah Chelli)

If I remove some letters, I can login, otherwise it loops me again.

The code may contain a limit on name length. Btw, UTF-8 has variable char size, Arabic char use 2bytes, Chinese char may reach 4bytes.

My full name is around 10x2+14x1+5=39bytes

bhdouglass commented 7 years ago

Ok, I think I finally found the root of the problem! Apparently the library I'm using for openid logins, doesn't properly support POST requests. I've modified my Ubuntu login wrapper lib to handle it. Try it now and let me know if it works!

sneetsher commented 7 years ago

@bhdouglass, yes I confirm that, I can login with my full name.

bhdouglass commented 7 years ago

Awesome! Thanks for bearing with me.