Android: Username normalization in owncloud beta (2.5.1-beta 1) prevents login with ldap user

Created on 11 Sep 2017  路  26Comments  路  Source: owncloud/android

Actual behaviour

  • Username is altered (or normalized) automatically after first login. Space is changed to underscore.

Expected behaviour

-Username should not be altered.

Steps to reproduce

  1. Install owncloud latest beta. (Hint: Same behavior with latest nextcloud dev-version)
  2. Login with username containing a space. [Here authentication is done against LDAP server]. First login works, but app (almost) instantly redirects back to login screen, where you have to login again. But:
  3. Username is changed from 'Firstname Lastname' to 'Firstname_Lastname' and the username field can't be modified, so the username can't be changed and the user can't authenticate against LDAP server. User is locked out and has to reinstall app.

Note

Username is not changed with latest ownCloud stable (2.4.0) (or latest nextcloud).

Workaround

[Only works in nextcloud-dev:] Also configure to login with Email-Account as login attribute in LDAP. Username is changed as described above in app, but login is done with Email-Address.
Update: After some time, nextcloud decided to change my username from [email protected]@owcloudserver.com to [email protected].
Conclusion: Some recent change in the owncloud and nextcloud app changes the login account to the username in owncloud. But this is not necessarily my login username.
Now it seems, that oc and nextcloud share a recent code change. All the time, I wished that both Teams work together to fix the instant upload issue. Now I wish, that they did not work together. :-)

Environment data

Android version: 7.0
Device model: Samsung Galaxy S7
Stock or customized system: Stock
ownCloud app version: 2.5.0 beta 2
ownCloud server version: 9.1.6

All 26 comments

This is like the regression we found in the tasks of 2.5.0 official version. We will study it. Thanks for reporting!!!!!

Today I was redirected to login page over and over again, like described above. This is version 2.5.1-beta.1
Is this supposed to be fixed in 2.5.1-beta.1?
After uninstalling and reinstalling, app crashed permanently. Fixed this by clearing app data and cache. After entering server and credentials, it did not happen again (rebooted to be sure).

after clearing, is the problem fixed?

No. Problem persists: I'm logged in and after one or two seconds, I'm back at the logon screen. As far as my LDAP-Server is concerned, logon is successful.

Since a restart seem not to be enough to trigger this, there seems to be some "time-dependent-token" involved. I just reinstalled and cleared data & cache to get it working again. Clearing data & cache doesn't work. I need to uninstall the app. Working again.

Edit: Honestly, I don't know why, but I got this link in my mailbox.

it would be helpful a test account in your server to try to reproduce the problem. Would it be posible? in this case, you can ship test credentials to [email protected]

Regarding your mail, the link you posted comes from a different company's product.

Tomorrow I can send you credentials. But there are no login failures, so that might not be helpful at all.

Regarding the link: the solution mentioned there is surely no fix for this problem? I don't know what Tobias is talking about, but it might be worth to look at the problem/solution.

Right now it works as supposed and I can't manage to break it. 馃榿

I did not wanted to highjack this thread, but since you mentioned me.
Your problem with whitespaces in username is solved in nc app, as you said in your "update" in the first comment. However there was still a little bug where such users with whitespaces could not set/unset a file as favorite, so I mentioned you in this fix, to let you know that now everything will work (in nc app).

i will check all the stuff again. thanks all.

CC @davigonz

Ok. OC is redirecting me again. Credentials send.

@jesmrec: Thanks a lot!
@tobiasKaminsky: Thanks for your explanation. Since login seems to be fine (checked the server logs), I don't think that a whitespace in my username is the root cause for my problem. But hey, I'm just a user here...

first of all, thanks for the test account @jensd0e.

Some thoughts:

  • Checking your account, i could not reproduce the problem. After logging, i was never redirected to login view when i perform some different actions in the account. In any case, Android app is ready to handle with blanks in the user field, as the server does.

  • About editing the username: our policy always was that a different username means a different account. In any case, i do not understand why you said that changing the username makes you to reinstall the app. You can not change the username, but you can re-attach the account without reinstalling.

@jesmrec: Since installing ownCloud today (about 7 hours ago), it didn't "break" ("break": eternally redirecting me to logon screen). Yesterday it worked from afternoon (fresh install) until today in the morning. It "broke" somewhere in between.

I don't think my current problem has anything to do with my username having a white-space in it. It seems I have hijacked this thread (I started) for this new problem. :-(

About changing my username: that was just as a workaround for the problem, described in the OP. I'm using my initial username for weeks. As another test, I also installed ownCloud 2.5.0 - just to see, if my problem originates from my phone, since with version 2.5.0 I never had the redirecting error.

ok... so we will have more patience to catch what is that breaks. i keep on checking your account.

Ok, It's broken again: ownCloud (2.5.1-beta.1) always redirects me to login page. After entering my (valid) credentials, I see my root folder for a short time (time is varying each time) before I'm send back to login screen.

Are there any log-files, I can pull off the phone? And if so, where are they stored?

OwnCloud 2.5.0 is still working.

you can find logs in settings view, in case of the beta.

Are the logs removed, if I reinstall? It's easier to grab them via adb, if I only knew where to look.
Edit: Found the log-files!

@jesmrec Now I have a log-file from the point, where I push the connect button, until I'm redirected. If you like, I'd be glad to send it to you.

ownCLoud 2.5.0 still working...

thanks! send a new mail to [email protected] attaching the file

Logfile should be in your inbox.

@jensd0e we did not receive the logs :(

[@jesmrec: Ok - now I know what happens, if I reply to your E-Mail with a text file attached... Scary!]

Seems to be stuck somewhere. I just send the logfile again. Please contact me, if no E-Mail arrives.

mail received!

@jesmrec Same problem here, from a fresh install debian9 and owncloud 10.0.4.4, when using ownCloudBeta-android/2.5.1-beta.1 always redirects me to login page.

After entering my (valid) credentials, I see my root folder for a short time before I'm send back to login screen.

With ownCloud-android/2.5.0 no problem at all. Windows or web interface, also without problems.

Still trying to reproduce it, it will not be included in 2.6.0 release, moving it...

@jensd0e , @pjao , please follow up https://github.com/owncloud/android/issues/1964 where we are talking about the login redirection in beta app.

I will keep this issue opened to fix the problem described in the first comment, not the login redirection one.

We deprecated the beta app described in this issue and the solution proposed here is no longer needed, so this shouldn't happen again with the new beta version.

I will close this, if you want to know how to join our new betas, please have a look at the end of our readme file

Was this page helpful?
0 / 5 - 0 ratings