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

State token does not match #1017

Closed
antonengelhardt opened this issue Dec 12, 2022 · 23 comments · Fixed by nextcloud/server#36286
Closed

State token does not match #1017

antonengelhardt opened this issue Dec 12, 2022 · 23 comments · Fixed by nextcloud/server#36286

Comments

@antonengelhardt
Copy link

Steps to reproduce

  1. Open App
  2. Try Log in

Expected behaviour

I expected to be logged in

Actual behaviour

I got an error saying "State token does not match"

Device information

Device: iPhone 14 Pro

iOS version: 16.1.2 (20B110)

Talk version: 15.1.1

Server information

Nextcloud version: (see admin overview page: /index.php/settings/admin/overview)

Talk version: (see apps admin page: /index.php/settings/apps)

Custom Signaling server configured: yes/no and version (see talk admin settings: /index.php/settings/admin/talk#signaling_server)

Custom TURN server configured: yes/no (see talk admin settings: /index.php/settings/admin/talk#turn_server)

Custom STUN server configured: yes/no (see talk admin settings: /index.php/settings/admin/talk#stun_server)

Server log (data/nextcloud.log)

<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /ocs/v1.php/cloud/capabilities?format=json HTTP/1.1" 200 2832 "-" "Mozilla/5.0 (iOS) Nextcloud-Talk v15.1.1"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /index.php/login/flow HTTP/1.1" 200 9080 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /core/css/login/authpicker.css?v=e4f15937-0 HTTP/1.1" 200 762 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /apps/theming/css/default.css?v=47354877-0 HTTP/1.1" 200 1499 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /apps/files_rightclick/css/app.css?v=1bf6e69c-0 HTTP/1.1" 200 728 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /core/css/guest.css?v=e4f15937-0 HTTP/1.1" 200 5840 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /core/l10n/en_GB.js?v=e4f15937-0 HTTP/1.1" 200 6324 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /dist/core-main.js?v=e4f15937-0 HTTP/1.1" 200 50621 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /core/css/server.css?v=e4f15937-0 HTTP/1.1" 200 27554 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /apps/theming/manifest?v=0 HTTP/1.1" 200 1029 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /core/js/oc.js?v=e4f15937 HTTP/1.1" 200 2286 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /dist/core-files_fileinfo.js?v=e4f15937-0 HTTP/1.1" 200 1064 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /core/js/backgroundjobs.js?v=e4f15937-0 HTTP/1.1" 200 1151 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /core/js/login/authpicker.js?v=e4f15937-0 HTTP/1.1" 200 788 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /dist/core-files_client.js?v=e4f15937-0 HTTP/1.1" 200 4839 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /dist/files_sharing-main.js?v=e4f15937-0 HTTP/1.1" 200 797 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/files_rightclick/l10n/en_GB.js?v=e4f15937-0 HTTP/1.1" 200 834 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/files_sharing/l10n/en_GB.js?v=e4f15937-0 HTTP/1.1" 200 2740 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/files_rightclick/js/script.js?v=e4f15937-0 HTTP/1.1" 200 3764 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/files_rightclick/js/files.js?v=e4f15937-0 HTTP/1.1" 200 1814 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/js/theming.js?v=e4f15937-0 HTTP/1.1" 200 549 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/l10n/en_GB.js?v=e4f15937-0 HTTP/1.1" 200 1978 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/theme/light-highcontrast.css?plain=1&v=b6589fc6 HTTP/1.1" 200 1834 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/theme/default.css?plain=1&v=b6589fc6 HTTP/1.1" 200 1792 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/theme/light-highcontrast.css?plain=0&v=b6589fc6 HTTP/1.1" 200 1852 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/theme/light.css?plain=1&v=b6589fc6 HTTP/1.1" 200 1792 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/theme/light.css?plain=0&v=b6589fc6 HTTP/1.1" 200 1814 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /js/core/merged-template-prepend.js?v=e4f15937-0 HTTP/1.1" 200 4022 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/theme/opendyslexic.css?plain=0&v=b6589fc6 HTTP/1.1" 200 1170 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/theme/dark.css?plain=0&v=b6589fc6 HTTP/1.1" 200 1805 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/theme/dark-highcontrast.css?plain=0&v=b6589fc6 HTTP/1.1" 200 1851 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /dist/icons.css HTTP/1.1" 200 31513 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:39 +0000] "GET /dist/core-common.js?v=e4f15937-0 HTTP/1.1" 200 3049869 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /apps/theming/theme/dark.css?plain=1&v=b6589fc6 HTTP/1.1" 200 1786 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /core/img/logo/logo.svg HTTP/1.1" 200 1297 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:40 +0000] "GET /core/img/app-background.jpg HTTP/1.1" 200 190778 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:41 +0000] "GET /apps/theming/theme/dark-highcontrast.css?plain=1&v=b6589fc6 HTTP/1.1" 200 1834 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:41 +0000] "GET /cron.php HTTP/1.1" 200 867 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:42 +0000] "GET /login/flow/grant? HTTP/1.1" 303 802 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:42 +0000] "GET /login?redirect_url=/login/flow/grant? HTTP/1.1" 200 7776 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:42 +0000] "GET /apps/theming/manifest?v=0 HTTP/1.1" 200 1029 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:42 +0000] "GET /dist/core-login.js?v=e4f15937-0 HTTP/1.1" 200 31358 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:42 +0000] "GET /core/js/oc.js?v=e4f15937 HTTP/1.1" 200 2286 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:42 +0000] "GET /core/img/loading-dark.gif HTTP/1.1" 200 5163 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:42 +0000] "GET /cron.php HTTP/1.1" 200 867 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:48 +0000] "POST /login HTTP/1.1" 303 931 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:49 +0000] "GET /login?redirect_url=/login/flow/grant?&direct=1&user=antonengelhardt HTTP/1.1" 200 7824 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:49 +0000] "GET /apps/theming/manifest?v=0 HTTP/1.1" 200 1029 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:49 +0000] "GET /core/js/oc.js?v=e4f15937 HTTP/1.1" 200 2286 "-" "iPhone (Nextcloud Talk)"
<ip-hidden> - - [12/Dec/2022:09:05:50 +0000] "GET /cron.php HTTP/1.1" 200 867 "-" "iPhone (Nextcloud Talk)"```
</details>
@antonengelhardt
Copy link
Author

image

@SystemKeeper
Copy link
Collaborator

I've seen this, but I'm not sure if it's really talk-ios related but rather a server bug...
As a workaround use the QR code option to login, that should always work.

@antonengelhardt
Copy link
Author

@SystemKeeper Thanks. After some more research I got it working.

@ekallevig
Copy link

@antonengelhardt I've just run into this on a fresh nextcloud server instance. I can login from web and the android nextcloud talk app, but seeing this for ios talk app. How did you resolve it?

@antonengelhardt
Copy link
Author

@ekallevig I used the QRcode to login. I can give you more detailed info tomorrow.

@ekallevig
Copy link

@antonengelhardt thanks. I've been able to do that but it's a rather bad bug that you can't login with username/pass, no?

@antonengelhardt
Copy link
Author

@ekallevig I think so too. This workaround does the trick but it's just a workaround...

@ekallevig
Copy link

Maybe this ticket should be reopened? Seems like a bug only affecting the iOS client. image

@antonengelhardt
Copy link
Author

@ekallevig Good idea. Done

@HuguesDug
Copy link

HuguesDug commented Jan 21, 2023

I confirm the problem.
I could not login totay on IOS with the exact same message.
The same account, on Android and Webclient, works with no issue.

Latest stable release nextcloud : 25.0.3
Latest stable release of Talk : 15.0.3
IOS on Iphone 6

I have deleted all the tokens being present for the user and I will give it a new try.

@ekallevig
Copy link

My current setup:

Machine A (caddy reverse proxy) 192.168.1.184
Machine B (nextcloud) 192.168.1.183

Firewall port forwarding:

80 -> Machine A
443 -> Machine A
8443 -> Machine B
3478 -> Machine B

Machine A (caddy reverse proxy):

Caddyfile

https://<domain>:443 {
    reverse_proxy 192.168.1.183:11000
}

https://<domain>:8443 {
    reverse_proxy https://192.168.1.183:8080 {
        transport http {
            tls_insecure_skip_verify
        }
    }
}

Machine B (nextcloud):

docker-compose.yml

version: "3.8"

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer # This line is not allowed to be changed

services:
  nextcloud:
    image: nextcloud/all-in-one:latest
    restart: always
    container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config # This line is not allowed to be changed
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 8080:8080
    environment:
      - APACHE_PORT=11000

This setup works fine for these clients:

  • iOS NextCloud App
  • Android NextCloud App
  • Android NextCloud Talk App
  • Linux Desktop AppImage
  • Web

Only the iOS NextCloud Talk App is having this issue logging in under this setup. If it is resolvable through some server config changes, then it's only because the iOS talk client is looking for something different than all these other clients.

@SystemKeeper
Copy link
Collaborator

Thanks for all the reports! We're not doing something special here, but I have seen this message occasionally myself. I just tried it myself and was able to login successfully most of the time (not always, but most of the time). I have a rough idea what could be the problem here. If any of you would be up for a test, please try to login again using username and password (remove the account before that obviously). After entering the URL and pressing "Log in" wait a few seconds on the next page before you select "Log in" on that one.

@ekallevig
Copy link

That worked! If I wait a while before clicking login it works. If I click login right away, I get the "State token does not match" error.

@SystemKeeper
Copy link
Collaborator

That worked! If I wait a while before clicking login it works. If I click login right away, I get the "State token does not match" error.

Thanks for confirming, that's exactly what I expected. I have already fixed it locally, so will do a PR later.

@HuguesDug
Copy link

Looking forward the PR

@HuguesDug
Copy link

I tried to "wait a while" prior from going to a login screen to the next one, as advised.
It did not solve the problem.

Finally, I tested on an android device again, by reauthorizing the already existing account. It ended up with an error message (wrong password) although it was totally correct and the system even showing me the conversations.
Finally, the Android version brought me back to the "enter your server" screen and from there, it worked.

There is clearly an overall problem with the latest version of NC, obviously on IOS (you can't login), but also on android (behavior is strange)

@SystemKeeper
Copy link
Collaborator

Thank you for your comment. If there’s a general issue, then this is the wrong repo to report it. I was able to reproduce the mentioned issue and create a pull request on the server repo. If this is not working for you, I don’t have a good idea right now other than to create an issue on server with as much debug information as possible.
The message about the wrong password on the other hand sound like a different issue than this one. Maybe you could create a test user with a simple password and try again to make sure there’s nothing special about the user or the password?

@HuguesDug
Copy link

No, nothing special with the password. All went OK at second try. Super strange.

@SystemKeeper
Copy link
Collaborator

I suggest we wait until the patch gets in and see if this resolved the situation already, before we go on and look for something that might not be there.

@HuguesDug
Copy link

For the time being, connected with QR code.i confirm it works

@muekno
Copy link

muekno commented Feb 17, 2023

same problem with may android 7 and davx5, new install of nextcloud 25.0.3, no sync of contacts possible.
Sync of files work, snc to my iMAC contacts app works. sync of contact to android no chance took me hours on trying and research
Need a solution
Regards Rainer

@SystemKeeper
Copy link
Collaborator

Hey @muekno
you can find the solution in this issue and in the linked PR 😃
Other than that, if there's a specific issue with android and/or davx5, this is not the right place.

@soyjulius
Copy link

Me funciono haciendo el Login en una pestaña de incógnito copiando el Link.

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

Successfully merging a pull request may close this issue.

6 participants