nextcloud / nextcloud/Android-SingleSignOn

Access not possible when using a HTTP redirect

Open
#200 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

approved bug
Dominant language
Java
Stars
74
Forks
36
Avg merge
1d 19h
Merged PRs (30d)
17

Description

I have an NC installation that was relocated in the past. To keep things for older installations/users working I added an HTTP redirect (302 at the moment). This breaks the notes app on android.
I contacted the developer there and he tells me that he uses this library in order to do all network-based stuff. He asked me to open an issue here to ake you aware of the issue.

Here is the information I got from the app:
App Version: 2.11.8
App Version Code: 2011008
App Flavor: play

Files App Version Code: 30110151

---

OS Version: 3.0.31-1678704(N8000XXSDQA7)
OS API Level: 19
Device: p4noterf
Manufacturer: samsung
Model (and Product): GT-N8000 (p4noterfxx)

---

com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: 
HTTP-Anfrage ist fehlgeschlagen mit HTTP-Statuscode: 302
        at 
com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:172)
        at 
com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:148)
        at 
it.niedermann.owncloud.notes.persistence.NotesClient.requestServer(NotesClient.java:162)
        at 
it.niedermann.owncloud.notes.persistence.NotesClient.getNotes(NotesClient.java:98)
        at 
it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.pullRemoteChanges(NoteServerSyncHelper.java:446)
        at 
it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.doInBackground(NoteServerSyncHelper.java:358)
        at 
it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.doInBackground(NoteServerSyncHelper.java:320)
        at android.os.AsyncTask$2.call(AsyncTask.java:288)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.IllegalStateException: <!DOCTYPE HTML PUBLIC 
"-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a 
href="https://new.url.of.my.installation/nextcloud/index.php/apps/notes/api/v0.2/notes?pruneBefore=0">here</a>.</p>
</body></html>

        at 
com.nextcloud.android.sso.InputStreamBinder.processRequestV2(InputStreamBinder.java:438)
        at 
com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestAndBodyStreamV2(InputStreamBinder.java:135)
        at 
com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestV2(InputStreamBinder.java:118)
        at 
com.nextcloud.android.sso.aidl.IInputStreamService$Stub.onTransact(IInputStreamService.java:134)
        at android.os.Binder.execTransact(Binder.java:404)
        at dalvik.system.NativeStart.run(Native Method)

I only changed the URL domain in the backtrace.

If you need more information or anything I can provide, please let me know.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at AidlNetworkRequest.performNetworkRequestV2 and InputStreamBinder.processRequestV2, which the stack trace identifies as the request path. Inspect how HTTP 302 responses are handled; done means the reported Notes app request can use the relocated installation through the redirect.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.