matrix-org / sydent

Sydent: Reference Matrix Identity Server
http://matrix.org
Apache License 2.0
293 stars 84 forks source link

Matrix homeserver did not include 'sub' in its response #587

Closed mikesrus closed 4 months ago

mikesrus commented 6 months ago

Hello I would like to use the dedicated server ID for selfhosted matrix server, but I get a problem. When i try add id server in element (web / android) I see request to sydent

https://talk.domain.ltd/_matrix/identity/v2/account/register with the following contents

{"access_token":"............................","token_type":"Bearer","matrix_server_name":"talk.domain.ltd","expires_in":3600}

But i get responce with error 500 and the following text

{
"error code": "M_UNKNOWN",
"error": "Matrix home server did not include "sub" in its response"
}

in the logs at the same time, I see


2024-03-22 07:16:43,495 - twisted - 147 - INFO - "::ffff:172.17.0.1" - - [22/March/2024:07:16:43 +0000] " PARAMETERS /_matrix/identity/v2/account/registration HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36"
2024-03-22 07:16:43,509 - twisted - 147 - INFO - DNSDatagramProtocol, starting from 38375
2024-03-22 07:16:43.510 - twisted - 147 - INFORMATION - Launch protocol <twisted.names.dns.DNSDatagramProtocol object at 0x7f9a4b24b580>
2024-03-22 07:16:43.513 - twisted - 147 - INFO - DNSDatagramProtocol, starting from 5497
2024-03-22 07:16:43.514 - twisted - 147 - INFORMATION - Launch Protocol <twisted.names.dns.DNSDatagramProtocol object at 0x7f9a4b247940>
2024-03-22 07:16:43.515 - twisted - 147 - INFO - (UDP-port 38375 is closed)
2024-03-22 07:16:43.516 - twisted - 147 - Information stop protocol <twisted.names.dns.DNSDatagramProtocol object at 0x7f9a4b24b580>
2024-03-22 07:16:43.613 - sydent.http.matrixfederationagent - 405 - INFO - Endpoint created with b'talk.domain.ltd.ru ':8448
2024-03-22 07:16:43.615 - twisted - 147 - INFO - (UDP port 5497 closed)
2024-03-22 07:16:43.616 - twisted - 147 - Information stop protocol <twisted.names.dns.DNSDatagramProtocol object at 0x7f9a4b247940>
2024-03-22 07:16:43.624 - sydent.http.servlets.registerservlet - 72 - WARNING - The Matrix home server did not include "sub" in its response

What is missing in the request? what is a "sub"? aditional info, configs needed?

reivilibre commented 4 months ago

I think sub is supposed to come from the /_matrix/federation/v1/openid/userinfo endpoint.

See: https://github.com/matrix-org/sydent/blob/fdde810deb6e8cf2bf74a3ac8a941564af3798bc/sydent/http/servlets/registerservlet.py#L98

Is the 'openid' endpoint enabled on your homeserver?

reivilibre commented 4 months ago

There doesn't seem to be enough information here in order to reproduce or fix this issue right now.

I will close this issue but it can be reopened (or a new issue, linking to this one, opened) if the issue recurs with more information available.

Thank you.