matrix-org / matrix-org/matrix-hookshot
HS'es using MAS, Hookshot can't login / Support MSC4190
- Dominant language
- TypeScript
- Stars
- 450
- Forks
- 95
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 23
Description
We at hacklab.fi homeserver have migrated to MAS few months ago, Hookshot kept working probably because existing access tokens got migrated to MAS and they kept working.
Now we have installed new servers for Matrix and etc, with sunsetting old server and migrated everything to new one. One thing we also did was to reset Hookshot encryption on the way, but now it can't log in anymore because:
Hookshot error:
```
Aug 20 20:13:26 morpheus nvm-exec[576342]: {"level":"INFO","message":"Prefilling room membership for permissions for 0 rooms","module":"Config","timestamp":"20:13:26:045"}
Aug 20 20:13:26 morpheus nvm-exec[576342]: {"level":"ERROR","message":"(REQ-7) { errcode: 'M_UNKNOWN', error: 'Invalid login type' }","module":"MatrixHttpClient","timestamp":"20:13:26:046"}
Aug 20 20:13:26 morpheus nvm-exec[576342]: {"level":"ERROR","message":"Failed to set up crypto on intent @hookshot:hacklab.fi MatrixError: M_UNKNOWN: Invalid login type\n at Object.defaultErrorHandler [as errorHandler] (/opt/hookshot/matrix-hookshot/node_modules/matrix-bot-sdk/src/http.ts:9:9)\n at doHttpRequest (/opt/hookshot/matrix-hookshot/node_modules/matrix-bot-sdk/src/http.ts:119:31)\n at processTicksAndRejections (node:internal/process/task_queues:105:5)\n at MatrixClient.descriptor.value (/opt/hookshot/matrix-hookshot/node_modules/matrix-bot-sdk/src/metrics/decorators.ts:28:32)\n at /opt/hookshot/matrix-hookshot/node_modules/matrix-bot-sdk/src/appservice/Intent.ts:175:41 {\n body: { errcode: 'M_UNKNOWN', error: 'Invalid login type' },\n statusCode: 400,\n errcode: 'M_UNKNOWN',\n error: 'Invalid login type',\n retryAfterMs: undefined\n}","module":"Appservice","timestamp":"20:13:26:053"}
Aug 20 20:13:26 morpheus nvm-exec[576342]: /opt/hookshot/matrix-hookshot/node_modules/matrix-bot-sdk/src/http.ts:9
Aug 20 20:13:26 morpheus nvm-exec[576342]: new MatrixError(errBody, response.statusCode, response.headers) : undefined;
Aug 20 20:13:26 morpheus nvm-exec[576342]: ^
Aug 20 20:13:26 morpheus nvm-exec[576342]: Error: M_UNKNOWN: Invalid login type
Aug 20 20:13:26 morpheus nvm-exec[576342]: at Object.defaultErrorHandler [as errorHandler] (/opt/hookshot/matrix-hookshot/node_modules/matrix-bot-sdk/src/http.ts:9:9)
Aug 20 20:13:26 morpheus nvm-exec[576342]: at doHttpRequest (/opt/hookshot/matrix-hookshot/node_modules/matrix-bot-sdk/src/http.ts:119:31)
Aug 20 20:13:26 morpheus nvm-exec[576342]: at processTicksAndRejections (node:internal/process/task_queues:105:5)
Aug 20 20:13:26 morpheus nvm-exec[576342]: at MatrixClient.descriptor.value (/opt/hookshot/matrix-hookshot/node_modules/matrix-bot-sdk/src/metrics/decorators.ts:28:32)
Aug 20 20:13:26 morpheus nvm-exec[576342]: at /opt/hookshot/matrix-hookshot/node_modules/matrix-bot-sdk/src/appservice/Intent.ts:175:41
Aug 20 20:13:26 morpheus nvm-exec[576184]: error Command failed with exit code 1.
```
Corresponding MAS log:
```
Aug 20 20:13:26 morpheus mas-cli[1945]: 2025-08-20T17:13:26.044385Z WARN mas_handlers::compat::login:226 POST-357711 - unsupported login method
Aug 20 20:13:26 morpheus mas-cli[1945]: 2025-08-20T17:13:26.044409Z WARN http.server.response POST-357711 - "POST /_matrix/client/v3/login HTTP/1.1" 400 Bad Request "-" [polls: 3, cpu: 0.1ms, elapsed: 0.4ms]
```
I think practically Hookshot is lacking [MSC4190](https://github.com/matrix-org/matrix-spec-proposals/blob/quenting/as-device-management/proposals/4190-as-device-management.md).
Contributor guide
Research direction
Start by tracing Hookshot's login request that reaches POST /_matrix/client/v3/login and compare its supported login method with MSC4190 and the MAS warning about an unsupported method. Done means a newly encrypted Hookshot installation can authenticate against a MAS homeserver without the Invalid login type error; use the reported MatrixHttpClient and Appservice stack trace as the initial entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100