tdfischer / pto

IRC to Matrix bridge
Apache License 2.0
48 stars 8 forks source link

panicked at 'Could not login!: BadStatus(Unauthorized) #64

Open miquels opened 8 years ago

miquels commented 8 years ago

I built PTO, using the fix-build branch from perezdc (see https://github.com/tdfischer/pto/pull/63 ). But pto doesn't authenticate correctly against my matrix-synapse instance. I did an strace, and I see that the initial login goes ok, synapse returns an access_token, but it's not used in the next request.

POST /_matrix/client/api/v1/login? HTTP/1.1\r\n
Content-Length: 61\r\n
Host: localhost:8008\r\n
\r\n
{\"password\":\"bla123\",\"type\":\"m.login.password\",\"user\":\"mike\"}"

HTTP/1.1 200 OK\r\n
Content-Length: 665\r\n
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept\r\n
Server: Synapse/0.16.1-r1\r\n
Date: Tue, 09 Aug 2016 14:25:14 GMT\r\n
Access-Control-Allow-Origin: *\r\n
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\r\n
Content-Type: application/json\r\n
\r\n
{\"access_token\":\"MDAxZmxvY2F0aW9uIG1hdHJpeC54czRhbGwubmV0CjAwMTNpZGVudGlmaWVyIGtleQowMDEwY2lkIGdlbiA9IDEKMDAyYWNpZCB1c2VyX2lkID0gQG1pa2U6bWF0cml4LnhzNGFsbC5uZXQKMDAxNmNpZCB0eXBlID0gYWNjZXNzCjAwMWRjaWQgdG"...

GET /_matrix/client/v2_alpha/sync?full_state=true HTTP/1.1\r\n
Host: localhost:8008\r\n
\r\n

HTTP/1.1 401 Unauthorized\r\n
Content-Length: 61\r\n
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept\r\n
Server: Synapse/0.16.1-r1\r\n
Date: Tue, 09 Aug 2016 14:25:15 GMT\r\n
Access-Control-Allow-Origin: *\r\n
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\r\n
Content-Type: application/json\r\n
\r\n
{\"errcode\":\"M_MISSING_TOKEN\",\"error\":\"Missing access token.\"}

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.