Skip to content

Different internal and login username cause JSONException for fetching user information #726

Description

@MorrisJobke

Actual behaviour

  • It uses the username that was entered during login (but this is not for sure the internal username - LDAP allows to use CN, email and a nickname together with the same password to login and maps internally to a UUID as username)

In the test we used the current master of the android app and logged in via abc@example.com but the internal username is abc.def - abc@example.com is only allowed to be used as username for the login form.

03-06 16:50:43.620 20551-25186/com.nextcloud.client D/ExistenceCheckRemoteOperation: Existence check for https://www.example.com/remote.php/webdav/ targeting for  existence finished with HTTP status 200
03-06 16:50:43.621 20551-25186/com.nextcloud.client D/OwnCloudClient #3: REQUEST GET /ocs/v1.php/cloud/users/abc@example.com
03-06 16:50:45.561 20551-25186/com.nextcloud.client W/HttpMethodBase: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
03-06 16:50:45.563 20551-25186/com.nextcloud.client D/GetRemoteUserInfoOperation: Successful response: {"ocs":{"meta":{"status":"failure","statuscode":998,"message":"The requested user could not be found"},"data":[]}}
03-06 16:50:45.564 20551-25186/com.nextcloud.client E/GetRemoteUserInfoOperation: Exception while getting OC user information
   org.json.JSONException: Value [] at data of type org.json.JSONArray cannot be converted to JSONObject
      at org.json.JSON.typeMismatch(JSON.java:100)
      at org.json.JSONObject.getJSONObject(JSONObject.java:613)
      at com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation.run(GetRemoteUserInfoOperation.java:137)
      at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
      at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:84)
      at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:41)
      at android.os.AsyncTask$2.call(AsyncTask.java:305)
      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
      at java.lang.Thread.run(Thread.java:761)

Expected behaviour

  • It should use the correct user name and fetch the user information for that username

Sadly I have no real access to the server and can't provide better steps. But maybe @mario @AndyScherzinger or @tobiasKaminsky have an idea about this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions