Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.6.0] Your login token is invalid or has expired (webflow login) #1412

Closed
Germano0 opened this issue Sep 10, 2019 · 52 comments · Fixed by nextcloud/server#17626
Closed

[2.6.0] Your login token is invalid or has expired (webflow login) #1412

Germano0 opened this issue Sep 10, 2019 · 52 comments · Fixed by nextcloud/server#17626
Assignees
Labels
Milestone

Comments

@Germano0
Copy link

Germano0 commented Sep 10, 2019

I am testing 2.6.0 RC1. Everytime I try to connect to Nextcloud server, Firefox opens a new tab and I get error from Nextcloud server Access forbidden Your login token is invalid or has expired. You don't even get any login prompt.
I tested this against multiple Nextcloud servers, and client clean installations

Operating system:
Fedora 30

Qt 5.12.4

Client package (From Nextcloud or distro) (Linux only):
Distro. I am the package maintainer

Server configuration

Nextcloud version: 16.0.4

Storage backend (external storage):

Logs

  1. Client logfile:

[OCC::Application::setupLogging "################## Nextcloud locale:[it_IT] ui_lang:[] version:[2.6.0git] os:[Fedora 30 (Thirty)]"
[OCC::Application::setupTranslations Using "it_IT" translation
[OCC::SocketApi::SocketApi server started, listening at "/run/user/1000/Nextcloud/socket"
[OCC::FolderMan::FolderMan setting remote poll timer interval to 5000 msec
[OCC::ownCloudGui::setupContextMenu Tray menu workarounds: noabouttoshow: false fakedoubleclick: false showhide: false manualvisibility: false
[OCC::FolderMan::setupFoldersMigration Setup folders from "/home/caterpillar/.config/Nextcloud/folders" (migration)
[OCC::ClientProxy::setupQtProxyFromConfig Set proxy configuration to use the prefered system proxy for http tcp connections
[OCC::ownCloudGui::slotOpenSettingsDialog No configured folders yet, starting setup wizard
[OCC::WebViewPage::WebViewPage Time for a webview!
[unknown Please register the custom scheme 'nc' via QWebEngineUrlScheme::registerScheme() before installing the custom scheme handler.
[OCC::OCUpdater::backgroundCheckForUpdate Checking for available update
[OCC::AccessManager::createRequest 2 "" "https://updates.nextcloud.org/client/?client=REMOVED_BY_ME%3D&version=2.6.0.0&platform=linux&oem=Nextcloud&versionsuffix=git" has X-Request-ID "1c00b9e5-1460-4583-bc5f-7d6fbadea0e5"
[OCC::PassiveUpdateNotifier::versionInfoArrived Client is on latest version!
[OCC::OwncloudSetupWizard::slotSystemProxyLookupDone No system proxy set by OS
[OCC::AccessManager::createRequest 2 "" "https://foo.bar/nextcloud/status.php" has X-Request-ID "REMOVED_BY_ME"
[OCC::AbstractNetworkJob::start OCC::CheckServerJob created for "https://foo.bar/nextcloud/" + "status.php" "OCC::OwncloudSetupWizard"
[OCC::CheckServerJob::finished No SSL session identifier / session ticket is used, this might impact sync performance negatively.
[OCC::CheckServerJob::finished status.php returns: QJsonDocument({"edition":"","installed":true,"maintenance":false,"needsDbUpgrade":false,"productname":"Nextcloud","version":"16.0.3.0","versionstring":"16.0.3"}) QNetworkReply::NoError Reply: QNetworkReplyHttpImpl(0x55fa30a48930)
[OCC::DetermineAuthTypeJob::start Determining auth type for QUrl("https://foo.bar/nextcloud/remote.php/webdav/")
[OCC::AccessManager::createRequest 2 "" "https://foo.bar/nextcloud/remote.php/webdav/" has X-Request-ID "21b01242-b410-4e84-9f69-121eee9e06bc"
[OCC::AbstractNetworkJob::start OCC::SimpleNetworkJob created for "https://foo.bar/nextcloud/" + "" "OCC::Account"
[OCC::AccessManager::createRequest 6 "PROPFIND" "https://foo.bar/nextcloud/remote.php/webdav/" has X-Request-ID "2d14cd51-3fe0-4ae9-a27a-7df8719b0121"
[OCC::AbstractNetworkJob::start OCC::SimpleNetworkJob created for "https://foo.bar/nextcloud/" + "" "OCC::Account"
[OCC::DetermineAuthTypeJob::checkBothDone Auth type for QUrl("https://foo.bar/nextcloud/remote.php/webdav/") is 4
[OCC::AccessManager::createRequest 4 "" "https://foo.bar/nextcloud/index.php/login/v2" has X-Request-ID "REMOVED_BY_ME"
[OCC::AbstractNetworkJob::start OCC::SimpleNetworkJob created for "https://foo.bar/nextcloud/" + "" "OCC::Account"
[OCC::Flow2Auth::openBrowser()::<lambda setting remote poll timer interval to 5000 msec
[OCC::AccessManager::createRequest 4 "" "https://foo.bar/nextcloud/index.php/login/v2/poll" has X-Request-ID "REMOVED_BY_ME"
[OCC::AbstractNetworkJob::start OCC::SimpleNetworkJob created for "https://foo.bar/nextcloud/" + "" "OCC::Account"
[OCC::AbstractNetworkJob::slotFinished QNetworkReply::ContentNotFoundError "Il server ha risposto "404 Not Found" a "POST https://foo.bar/nextcloud/index.php/login/v2/poll"" QVariant(int, 404)

  1. Web server error log:
    [10/Sep/2019:12:12:48 +0200] "POST /nextcloud/index.php/login/v2/poll HTTP/1.1" 404 2 "-" "Mozilla/5.0 (Linux) mirall/2.6.0git (Nextcloud)"

  2. Server logfile: nextcloud log (data/nextcloud.log):
    Empty

@rullzer
Copy link
Member

rullzer commented Sep 10, 2019

Could you provide us with a test account?

@Germano0
Copy link
Author

Could you provide us with a test account?

Yes, please contact me at myname.mysurname at gmail.com

@camilasan camilasan added the server Server related issues. label Sep 16, 2019
@hlprasu
Copy link

hlprasu commented Sep 30, 2019

Is this resolved?

@Germano0
Copy link
Author

Is this resolved?

No

@camilasan
Copy link
Member

Could you check this one @misch7? :)

@misch7
Copy link
Member

misch7 commented Sep 30, 2019

@Germano0 I sent you an e-mail about two weeks ago (2019-09-17).

Could you please check if it‘s in your spam folder? ;-)

Edit: Have you tried our 2.6.0 release build from last Friday too?

@misch7 misch7 self-assigned this Sep 30, 2019
@hlprasu
Copy link

hlprasu commented Oct 1, 2019 via email

@nunesgh
Copy link

nunesgh commented Oct 2, 2019

Same issue as @hlprasu here!

@PedroCAlvarez
Copy link

Same issus as @hiprasu here too!

nextcloud-client version 2.6.0 installed (on 2019-10-03) from ppa:nextcloud-devs/client for Kubuntu 18.04.3 (Bionic).

@misch7
Copy link
Member

misch7 commented Oct 4, 2019

@hlprasu, @nunesgh and @PedroCAlvarez: Could you please provide your NC server versions and exact steps you went through, to help us debugging and reproduce the issue?

Thanks 👍

@hlprasu
Copy link

hlprasu commented Oct 4, 2019 via email

@nunesgh
Copy link

nunesgh commented Oct 4, 2019

Server version: 16.0.4
Client OS: Kubuntu 18.04

I was already logged into my Nextcloud account when the update of the Desktop client was triggered. After it was done, the client requested me to login again, but without showing a login screen for entering username or password, as in previous versions of the client. Instead, I was redirected to my default browser and then received the login token error.

@Germano0
Copy link
Author

Germano0 commented Oct 4, 2019

@Germano0 I sent you an e-mail about two weeks ago (2019-09-17).
Could you please check if it‘s in your spam folder? ;-)

@misch7 I have not received your e-mail

Edit: Have you tried our 2.6.0 release build from last Friday too?

Yes. Could you please talk with @rullzer since I granted him access to my server?
Thank you

@PedroCAlvarez
Copy link

Hi @misch7,

NC server version is 16.0.0 running on Ubuntu 18.04 server.
NC client version 2.6.0 running on Kubuntu 18.04.

From KDE desktop I execute "Nextcloud":

  • Then it appears a window entitled (translation from spanish) "Nextcloud connection wizard". In this window I select "Enter" (the other option is "Register with a provider").

  • The next window asks for the NC server address, I fill the field with the address (for the moment is http), then "Next".

  • Then, two windows open, one with Konqueror in the adress: "http://server.adress/nextcloud/index.php/login/v2/flow" and the message "Access forbidden. Your login token is invalid or has expired". The other entitled "Nextcloud connection wizard" offering two option "Re-open Browser" or "Copy link". If a copy the link to any other browser the result is the same as with Konqueror.

Thank you,
Pedro

@BeamMeUpTo
Copy link

^ Same here...
18.04.1-Kubuntu
Nextcloud 16
Linux Syncclient 2.6 --> "Nextcloud connection wizard" offering two option "Re-open Browser" or "Copy link".
"Access forbidden. Your login token is invalid or has expired"

But no problems with Windows syncclient and android syncclient.?!?!

@Germano0
Copy link
Author

Germano0 commented Oct 4, 2019

But no problems with Windows syncclient and android syncclient.?!?!

Is it a question?

@BeamMeUpTo
Copy link

No, its a fact - I tested it ;) Both working - only the Linux client seems to be affected.

@dennisTGC
Copy link

dennisTGC commented Oct 4, 2019

Im experiencing this also.
Kubuntu 19.04 as client os, NC16 on the server

I have multiple NC environments, only the enviroment with 2FA is affected.

@nunesgh
Copy link

nunesgh commented Oct 5, 2019

My Nextcloud environment also has 2FA enabled.

@letinas
Copy link

letinas commented Oct 6, 2019

I too have the same issue. When I click on "grant access" nothing happens. Any idea what is going on?

@dcanones
Copy link

dcanones commented Oct 6, 2019

Same problem here guys, new installation, KDE Neon, self signed sertificate. Redirects to Web Browser and:

  • Access forbidden
  • Your login token is invalid or has expired

@PedroCAlvarez
Copy link

More info, just if helps: same server (16.0.0 running on Ubuntu 18.04 server)

  • NC Client 2.6.0 over Ubuntu 18.04 with Canonical worked well (build on 2019-09-27)
  • NC Client 2.6.0 over Win 10 worked well (build on 2019-09-27).

I guess the bug could be related with KDE (?) ...

@elhijo
Copy link

elhijo commented Oct 7, 2019

nc client 2.6.0 same issue on kubuntu AND ubuntu (thus I'm only changing desktop, both are installed on the same machine)
No issue if going back to 2.5.3.

Thanks,

@dcanones
Copy link

dcanones commented Oct 8, 2019

nc client 2.6.0 same issue on kubuntu AND ubuntu (thus I'm only changing desktop, both are installed on the same machine)
No issue if going back to 2.5.3.

Thanks,

I installed Nextcloud client using ppa and only 2.6 seems available there (https://launchpad.net/~nextcloud-devs/+archive/ubuntu/client), how did you go back to 2.5.3 version? Thanks

@dseichter
Copy link

one possible workaround/solution could be to disable the content security policy:
https://stackoverflow.com/questions/27323631/how-to-override-content-security-policy-while-including-script-in-browser-js-con
had issues on windows, linux with Nextcloud 17 and 2.6.0 clients. Disabling that option in firefox (my standard browser) I could grant the access.
Found out, that there is an issue of mixing http and https requests :(

@Germano0
Copy link
Author

Germano0 commented Oct 8, 2019

Can anybody please stop writing comments with the only purpose to say "I am affected too"?

Please just use add reaction button.
Thank you

@ledufakademy
Copy link

Can anybody please stop writing comments with the only purpose to say "I am affected too"?

Please just use add reaction button.
Thank you

sure.
But instead of bashing people reporting gracefuly bug : could you please gave us a tip in order to hepl to debug and correct this huge issue ? (log, debug, source code etc ...)

@Germano0
Copy link
Author

Germano0 commented Oct 9, 2019

But instead of bashing people reporting gracefuly bug : could you please gave us a tip in order to hepl to debug and correct this huge issue ? (log, debug, source code etc ...)

@ledufakademy If you read the comments you may have read that I granted access to my server to rullzer. So they have all they need. They even are able to reproduce theirself since it is a very common bug!

@ledufakademy
Copy link

But instead of bashing people reporting gracefuly bug : could you please gave us a tip in order to hepl to debug and correct this huge issue ? (log, debug, source code etc ...)

@ledufakademy If you read the comments you may have read that I granted access to my server to rullzer. So they have all they need. They even are able to reproduce theirself since it is a very common bug!

ok sorry , please excuse me.

@ourra
Copy link

ourra commented Oct 10, 2019

I think I found a workaround for this, that consists of forcing KDE to use a specific browser:

  1. Open the KDE menu and go to Applicacion -> Setting -> System Settings.
  2. Then, go to Personalization -> Applications -> Default Applications -> Web Brower.
  3. Where it says "Open http and https URLS" change the option "in an application based on the contents of the URL" to "in the following application", and select one (I use Firefox).
  4. Apply, and now the token verification URL opens correctly.

Screenshot_20191010_102312

  1. As a side effect, the token verification is requested every time I open the nextcloud client.

@rullzer
Copy link
Member

rullzer commented Oct 10, 2019

@Germano0 so I actually can login fine on your instance.

But what @ourra shows might make sense.
Since we have to send the token via GET (because it opens the window). we only allow to open the page once. So if you system is first checking what kind of page the URL is (basically doing the GET). It will have started the flow and reject the second one.

You should also see this in your webserver logs if you open it yourself.
You can actually try the flow yourself at: https://docs.nextcloud.com/server/17/developer_manual/client_apis/LoginFlow/index.html#login-flow-v2

@Germano0 could you drop you access log after you try to authenticate? (or by e-mail if you don't want it public).

@nunesgh
Copy link

nunesgh commented Oct 12, 2019

I can confirm that @ourra's solution has worked for me! Thank you so much!

@simonmicro
Copy link

simonmicro commented Oct 12, 2019

These are the steps to follow:

Close the Nextcloud client, if it was already open.
Open a terminal window (e.g. with Konsole or any other one)
Unset all the environment variables related to KDE:

I can confirm that @ourra ↑ workaround works for me too - but I've used that one by unsetting the KDE_* values.
@ourra Why did you deleted your comment containing this first workaround (the one from 10.10)? It simply works - also after reopening the client...

@ourra
Copy link

ourra commented Oct 12, 2019

Hi @simonmicro, I deleted the other workaround because it is a bit harder, since it is necessary to open a terminal and write some commands. Nevertheless, I write it here again and, in this way, people can choose the one they prefer or works better.

Another workaround consists of tricking the Nextcloud client to think that it is not executing in a KDE environment. These are the steps to follow:

  1. Close the Nextcloud client, if it was already open.
  2. Open a terminal window (e.g. with Konsole or any other one)
  3. Unset all the environment variables related to KDE:
    unset KDE_FULL_SESSION
    unset KDE_SESSION_UID
    unset KDE_SESSION_VERSION
  1. In that same terminal, launch again the Nextcloud client by executing its command:
    nextcloud &

  2. Enter the server URL and when the browser opens, it will not show the "expired token" error.

@letinas
Copy link

letinas commented Oct 13, 2019

Any idea how I could solve it under normal Ubuntu?

Here is what it looks like:
defaultApps

I have tried both with Chrome and Firefox and still have the same problem. When I click on the Grant access button, the small arrow moves a bit to the right and stays so until I click somewhere else, then it returns...

@pascal-niklaus
Copy link

pascal-niklaus commented Oct 14, 2019

This is not a great solution, but for anybody who just needs a working synchronization right now on (K)ubuntu 18.04: just installing the old artful packages worked for me. I figured this out because I have a computer that still worked after the update, and upon closer inspection it still contained the old nextcloud packages.

The files are:

libnextcloudsync0_2.3.3-20180415.190957~artful1_amd64.deb
nextcloud-client_2.3.3-20180415.190957~artful1_amd64.deb

@BeamMeUpTo
Copy link

For me @ourra solution worked out.... for one account!
But does anybody noticed that it is not possible anymore to add a second Account???

If I want to add a second account I always get the windows with:
Connect with Nextcloud > Re-open Browser > Copy link

This opens a window which says that access is already granted ;) Thats true, but for a different User.

Any solutions? Its not that urgent but it would be nice to know.

@letinas
Copy link

letinas commented Oct 14, 2019

I can't login with Windows either.

After opening the page in browser and inspecting the traffic, I see a warning:
Mixed Content: The page at 'https://ADDRESS/login/v2/grant?stateToken=Afp8U6MPuSs8CtYsdErNxWNTyQ9Pap006MdCPpsb4Kqj4ImdTPNAiJQGjsG4yIhc' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'http://ADDRESS/login/v2/grant'. This endpoint should be made available over a secure connection.

When I inspect the web browser traffic after hitting the grant access button I see the following error:
Refused to send form data to 'http://ADDRESS/login/v2/grant' because it violates the following Content Security Policy directive: "form-action 'self'".

This is weird because what I see in the web browser is https and not http.
I substituted my actual domain name with ADDRESS.

It seems that my browser isn't sending any data at all. Any ideas?

@simonmicro
Copy link

@BeamMeUpTo Yeah, thats all right - because you've already authenticated that client on that account (you stay logged in). Try to log out from all nextcloud instances (in your browser only) and try again.

@BeamMeUpTo
Copy link

BeamMeUpTo commented Oct 14, 2019

@simonmicro - Yes this was nearly the solution! Browser wasn't logged in anymore... so I killed nextcloud client and started again from shell. And a new browser login window appeared ;)
Now the two accounts work ;) Edit: Forgotten! - At the same time ;)

@flipreverse
Copy link

flipreverse commented Oct 16, 2019

I think I found a workaround for this, that consists of forcing KDE to use a specific browser:

1. Open the KDE menu and go to Applicacion -> Setting -> System Settings.

2. Then, go to Personalization -> Applications -> Default Applications -> Web Brower.

3. Where it says "Open http and https URLS" change the option "in an application based on the contents of the URL" to "in the following application", and select one (I use Firefox).

4. Apply, and now the token verification URL opens correctly.

1. As a side effect, the token verification is requested every time I open the nextcloud client.

Even the beta version of the client is affected:
$ nextcloud --version Nextcloud version 2.7.0git Using Qt 5.12.2, built against Qt 5.12.2 Using 'OpenSSL 1.1.1b 26 Feb 2019'
I'm using Kubuntu 19.04.

However, the quoted solution works for me. I cannot confirm the mentioned side effect. Even the solution in #1412 (comment) works.

@ANaumann85
Copy link

ANaumann85 commented Oct 16, 2019

the workaround given by @ourra #1412 (comment) works, but the unset of the shell variables in comment #1412 (comment) leads to the error messages:

/usr/bin/xdg-open: 492: test: Illegal number: 
/usr/bin/xdg-open: 493: test: Illegal number: 
/usr/bin/xdg-open: 494: test: Illegal number:

and the authentication problem persists.
But the problem looks KDE related and does not happen with every KDE version. If I switch to XFCE or I3 on the same machine, the authentication works.

Furthermore I was able to reproduce the issue with the KUbuntu image and the cloud provider
The steps I did are:

  • Install the image in a virtual box
  • within the KUbuntu virtual machine, install the packages KDE-standard and firefox
  • login with the KDE desktop environment
  • download the client
  • try to login at https://tuc.cloud

rullzer added a commit to nextcloud/server that referenced this issue Oct 21, 2019
It seems that KDE by default opens the url in secret.
Should fix: nextcloud/desktop#1412

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer
Copy link
Member

rullzer commented Oct 21, 2019

Please check the patch in nextcloud/server#17626
That should fix this.

@johnchristopher
Copy link

johnchristopher commented Oct 24, 2019

I think I found a workaround for this, that consists of forcing KDE to use a specific browser:

1. Open the KDE menu and go to Applicacion -> Setting -> System Settings.

2. Then, go to Personalization -> Applications -> Default Applications -> Web Brower.

3. Where it says "Open http and https URLS" change the option "in an application based on the contents of the URL" to "in the following application", and select one (I use Firefox).

4. Apply, and now the token verification URL opens correctly.

Screenshot_20191010_102312

1. As a side effect, the token verification is requested every time I open the nextcloud client.

This allowed me to get to the login step of the process and then to the authorization step but clicking the authorize button does nothing.

Wasn't there an option to simply input the login and the password in the client ? Can't we bring that back ?

Edit 2: See #1470

Edit: Moreover, the authorization message is a bit misleading:

You are about to authorize:
`Mozilla/5.0 (Linux) mirall/2.6.0git (Nextcloud)`
to access your nextcloud account.

Why should I grant access to a browser when what I am trying to do is connecting the Nextcloud desktop client ?

Poking around with the Firefox network tool I see there is a 302 after login which of course gives this message in the console:
Content Security Policy: Les paramètres de la page ont empêché le chargement d’une ressource à http://nextcloud.serveurencarton.be/index.php/login/v2/grant (« form-action »).

I see the first URL request is done with the HTTP protocol even though HTTPS was given in the wizard. Something is extracting the domain at some point and not putting back the protocol when doing the actual connection so that patch https://github.com/nextcloud/server/pull/17626/files doesn't work and it's actually a different bug.

Ubuntu 18.04, nextcloud-client from ppa devs, Nextcloud instance 17.0 from the docker image from dockerhub, behind traefik doing the SSL termination.

backportbot-nextcloud bot pushed a commit to nextcloud/server that referenced this issue Oct 26, 2019
It seems that KDE by default opens the url in secret.
Should fix: nextcloud/desktop#1412

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
backportbot-nextcloud bot pushed a commit to nextcloud/server that referenced this issue Oct 26, 2019
It seems that KDE by default opens the url in secret.
Should fix: nextcloud/desktop#1412

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@7rr-dev
Copy link

7rr-dev commented Oct 28, 2019

Working Workaround (Fedora v.32 64bit but should work on your system too):

  1. install or keep installed newest Nextcloud client 2.6.0
  2. delete ~/.config/Nextcloud folder in homefolder
  3. download Nextcloud binary 2.5.3 from official website
    https://download.nextcloud.com/desktop/releases/Linux/Nextcloud-2.5.3-x86_64.AppImage
  4. make it executable

chmod +x Nextcloud-2.5.3-x86_64.AppImage

  1. and run it ./Nextcloud-2.5.3-x86_64.AppImage
  2. It works: login and set everything up and let it sync once.
  3. Close the running Nextcloud-client instance and delete Nextcloud-2.5.3-x86_64.AppImage
  4. Start the Nextcloud 2.6.0 instance from your distribution, it will use logins stored in ~/.config/Nextcloud and will work like a charm

@rullzer
Copy link
Member

rullzer commented Oct 28, 2019

@johnchristopher your bug seems more like you have to set proper protocoloverwrite etc. Because Nextcloud thinks it is being access from http.

@mathisen99
Copy link

I think I found a workaround for this, that consists of forcing KDE to use a specific browser:

1. Open the KDE menu and go to Applicacion -> Setting -> System Settings.

2. Then, go to Personalization -> Applications -> Default Applications -> Web Brower.

3. Where it says "Open http and https URLS" change the option "in an application based on the contents of the URL" to "in the following application", and select one (I use Firefox).

4. Apply, and now the token verification URL opens correctly.

This solved it for me Thanks!

@joeySeal
Copy link

Just wanted to note that I had the same issue on Kubuntu 19.10 using PPA client and server 17.00 and it was corrected after upgrading to 17.01

@rigred
Copy link

rigred commented Dec 4, 2019

Generally I find this is a bug not purely in the Nextcloud client as such, but in the interaction between nextcloud client, kio on KDE systems and the nextcloud server.
In my case kio when intercepting was loosing part of the request.

If anyone sees this thread and is wondering what is going on:
The solution is to ensure that the request is directly sent to the preferred web browser, by setting it in default applications as outlined in the below quoted reply:

I think I found a workaround for this, that consists of forcing KDE to use a specific browser:

1. Open the KDE menu and go to Applicacion -> Setting -> System Settings.

2. Then, go to Personalization -> Applications -> Default Applications -> Web Brower.

3. Where it says "Open http and https URLS" change the option "in an application based on the contents of the URL" to "in the following application", and select one (I use Firefox).

4. Apply, and now the token verification URL opens correctly.

Screenshot_20191010_102312

1. As a side effect, the token verification is requested every time I open the nextcloud client.

This allowed me to get to the login step of the process and then to the authorization step but clicking the authorize button does nothing.

Wasn't there an option to simply input the login and the password in the client ? Can't we bring that back ?

Edit 2: See #1470

Edit: Moreover, the authorization message is a bit misleading:

You are about to authorize:
`Mozilla/5.0 (Linux) mirall/2.6.0git (Nextcloud)`
to access your nextcloud account.

Why should I grant access to a browser when what I am trying to do is connecting the Nextcloud desktop client ?

Poking around with the Firefox network tool I see there is a 302 after login which of course gives this message in the console:
Content Security Policy: Les paramètres de la page ont empêché le chargement d’une ressource à http://nextcloud.serveurencarton.be/index.php/login/v2/grant (« form-action »).

I see the first URL request is done with the HTTP protocol even though HTTPS was given in the wizard. Something is extracting the domain at some point and not putting back the protocol when doing the actual connection so that patch https://github.com/nextcloud/server/pull/17626/files doesn't work and it's actually a different bug.

Ubuntu 18.04, nextcloud-client from ppa devs, Nextcloud instance 17.0 from the docker image from dockerhub, behind traefik doing the SSL termination.

@devdan
Copy link

devdan commented Aug 11, 2020

Working Workaround (Fedora v.32 64bit but should work on your system too):

1. install or keep installed newest Nextcloud client 2.6.0

2. delete ~/.config/Nextcloud folder in homefolder

3. download Nextcloud binary 2.5.3 from official website
   https://download.nextcloud.com/desktop/releases/Linux/Nextcloud-2.5.3-x86_64.AppImage

4. make it executable

chmod +x Nextcloud-2.5.3-x86_64.AppImage

1. and run it ./Nextcloud-2.5.3-x86_64.AppImage

2. It works: login and set everything up and let it sync once.

3. Close the running Nextcloud-client instance and delete Nextcloud-2.5.3-x86_64.AppImage

4. Start the Nextcloud 2.6.0 instance from your distribution, it will use logins stored in ~/.config/Nextcloud and will work like a charm

Thank you so much for this! Finally, a workaround that worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.