nextcloud / notes-android

✎ Android client for Nextcloud Notes app.
https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes
GNU General Public License v3.0
905 stars 132 forks source link

302 is not an error, it is http->https #1936

Open teledyn opened 8 months ago

teledyn commented 8 months ago

Please use GitHub reactions 👍 to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug

Cannot login to https

To Reproduce Steps to reproduce the behavior:

  1. Open freshly installed app
  2. Choose a server that has https

Expected behavior

It should log in like every other nextcloud app

Screenshots

App Version: 4.1.0
App Version Code: 40010090
App Flavor: fdroid

Files App Version Code: 30260090 (PROD)

---

OS Version: 4.19.113-27223811(G781WVLSBHWI1)
OS API Level: 33
Device: r8q
Manufacturer: samsung
Model (and Product): SM-G781W (r8qcsx)

---

com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: HTTP request failed with HTTP status-code: 302
    at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:197)
    at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:180)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$0$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:122)
    at com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda0.subscribe(Unknown Source:6)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher.subscribeActual(ObservableFromPublisher.java:31)
    at io.reactivex.Observable.subscribe(Observable.java:12284)
    at io.reactivex.internal.operators.observable.ObservableSingleMaybe.subscribeActual(ObservableSingleMaybe.java:31)
    at io.reactivex.Maybe.subscribe(Maybe.java:4290)
    at io.reactivex.Maybe.blockingGet(Maybe.java:2320)
    at io.reactivex.Observable.blockingSingle(Observable.java:5381)
    at it.niedermann.owncloud.notes.persistence.CapabilitiesClient.getCapabilities(CapabilitiesClient.java:32)
    at it.niedermann.owncloud.notes.importaccount.ImportAccountActivity.lambda$onActivityResult$5$it-niedermann-owncloud-notes-importaccount-ImportAccountActivity(ImportAccountActivity.java:96)
    at it.niedermann.owncloud.notes.importaccount.ImportAccountActivity$$ExternalSyntheticLambda2.run(Unknown Source:4)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:463)
    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
    at java.lang.Thread.run(Thread.java:1012)
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://nas.teledyn.com/ocs/v2.php/cloud/capabilities?format=json">here</a>.</p>
</body></html>

    at com.nextcloud.android.sso.InputStreamBinder.processRequestV2(InputStreamBinder.java:454)
    at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestAndBodyStreamV2(InputStreamBinder.java:127)
    at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestV2(InputStreamBinder.java:110)
    at com.nextcloud.android.sso.aidl.IInputStreamService$Stub.onTransact(IInputStreamService.java:110)
    at android.os.Binder.execTransactInternal(Binder.java:1316)
    at android.os.Binder.execTransact(Binder.java:1280)

Smartphone (please complete the following information):

Server

Stacktrace

joshtrichards commented 1 month ago

Similar to #1605. Likely nextcloud/Android-SingleSignOn#200