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

Latest version of element in app store can't login get M_UNRECOGNIZED error #4785

Closed
brendanheywood opened this issue Sep 5, 2021 · 2 comments · Fixed by #4817
Closed

Latest version of element in app store can't login get M_UNRECOGNIZED error #4785

brendanheywood opened this issue Sep 5, 2021 · 2 comments · Fixed by #4817
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@brendanheywood
Copy link

brendanheywood commented Sep 5, 2021

Steps to reproduce

Around a week ago logins started to fail, presumably with an auto update. After being asked to re-login again it opens a webview popup which connects to our home server and then shows this error:

{"errcode": "M_UNRECOGNIZED", "error": "Unrecognized request"}

At first we thought it was something with our homeserver or our SSO but when attempting to connect to matrix.org we get the same error. It seems everyone in our organisation is getting the same error.

We have trialed using the Syphon iphone mobile app which does correctly connect (but the app seem beta quality) so it isn't an issue with our server or SSO.

What happened?

What did you expect?

Be prompted with the normal SSO login for our home server

What happened?

{"errcode": "M_UNRECOGNIZED", "error": "Unrecognized request"}

Your phone model

iPhone 11

Operating system version

ios 14.71

Application version

1.5.1

Homeserver

chat.catalyst-au.net

Have you submitted a rageshake?

No -Tried but could not get this to work

@brendanheywood brendanheywood added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Sep 5, 2021
@grantm
Copy link

grantm commented Sep 9, 2021

Just noting that when this failure happens we see this in the homeserver.log:

"GET /_matrix/client/r0/login/sso/redirect/?redirectUrl=element://connect?transaction_id%3Dm1554409636.1 HTTP/1.0"

Compared to a successful login via a web client:

"GET /_matrix/client/r0/login/sso/redirect?redirectUrl=https%3A%2F%2Fstaging.chat.catalyst.net.nz%2F%23%2F HTTP/1.0"

The key difference seems to be the trailing '/' on the URL path.

@pengufrost
Copy link
Contributor

Noting that the change to Riot/Modules/Authentication/SSO/SSOURLConstants.swift is very likely the cause of this issue

pengufrost pushed a commit to pengufrost/element-ios that referenced this issue Sep 10, 2021
lschuermann added a commit to lschuermann/princeton-sns-cluster that referenced this issue Sep 23, 2022
Element iOS will send a request to cause Synapse to redirect to the
SSO provider with a trailing slash:

    /_matrix/client/r0/login/sso/redirect/?...

This causes synapse to respond with an M_UNRECOGNIZED error. Thus, for
now, explicitly match on that URL and remove the trailing slash. nginx
takes care of the query parameters. This looks exactly like issue 4785
[1]; however this should have been fixed in all recent versions of
Element iOS.

[1]: element-hq/element-ios#4785
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants