You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.
I've got some automation scripts which use the _synapse/admin/... API endpoints, which need a authentication token.
Before MAS
Previously I:
Set admin to 1 for my users in the Synapse DB,
Log into Element Desktop, and
Use token from advanced settings page.
With MAS
Since switching to MAS this method no longer works, as per the docs, with this error:
{"errcode":"M_FORBIDDEN","error":"You are not a server admin"}
While the docs say that Synapse will no longer manage who is an admin, I couldn't see anything about how to manage this in MAS.
Workaround
As a workaround I've:
Set can_request_admin to true for my user in users in the MAS DB,
Log into Element Desktop,
Find my token in advance settings,
Find the associated compat_session_id in compat_access_tokens based on access_token (surprised tokens are stored in plain-text not salted and hashed - by design?),
Update is_synapse_admin to true in compat_sessions for my compat_session_id,
Use token from Element Desktop.
Proposed Solution
This feels very hacky, the sort of flow that I think would be ideal is:
Log in to MAS web UI.
is_synapse_admin is updated on the fly based on a configurable OIDC role attestation (maybe a CLI option to toggle as a fallback).
Click a button to generate a token.
Dialog opens to:
Set a friendly name,
Toggle a checkbox for if it should be an admin token (only shown for users where is_synapse_admin is true), and
Optionally, set a expiry period.
The new Token is shown once then unrecoverable through the UI.
Web UI has a tab for tokens, just like sessions and browsers, to allow manual revocation before expiry.
Questions
Is there a better way than my workaround to do this currently?
Would it be possible to get my proposed solution on the backlog - appreciate it may not be a high priority?
Thanks
The text was updated successfully, but these errors were encountered:
I've got some automation scripts which use the
_synapse/admin/...
API endpoints, which need a authentication token.Before MAS
Previously I:
admin
to1
for myusers
in the Synapse DB,With MAS
Since switching to MAS this method no longer works, as per the docs, with this error:
While the docs say that Synapse will no longer manage who is an admin, I couldn't see anything about how to manage this in MAS.
Workaround
As a workaround I've:
can_request_admin
totrue
for my user inusers
in the MAS DB,compat_session_id
incompat_access_tokens
based onaccess_token
(surprised tokens are stored in plain-text not salted and hashed - by design?),is_synapse_admin
totrue
incompat_sessions
for mycompat_session_id
,Proposed Solution
This feels very hacky, the sort of flow that I think would be ideal is:
is_synapse_admin
is updated on the fly based on a configurable OIDC role attestation (maybe a CLI option to toggle as a fallback).is_synapse_admin
istrue
), andQuestions
Thanks
The text was updated successfully, but these errors were encountered: