From 261d7156d2b614018992ede85662344b7f7dfbbb Mon Sep 17 00:00:00 2001 From: Twilight Sparkle Date: Wed, 3 Sep 2025 14:27:54 +0000 Subject: [PATCH 1/2] Request a refresh token in device-code-grant.sh --- misc/device-code-grant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/device-code-grant.sh b/misc/device-code-grant.sh index c77101cb5..a89c26fd2 100755 --- a/misc/device-code-grant.sh +++ b/misc/device-code-grant.sh @@ -45,7 +45,7 @@ RESP="$( { "client_name": "CLI tool", "client_uri": "https://github.com/element-hq/matrix-authentication-service/", - "grant_types": ["urn:ietf:params:oauth:grant-type:device_code"], + "grant_types": ["urn:ietf:params:oauth:grant-type:device_code","refresh_token"], "application_type": "native", "token_endpoint_auth_method": "none" } From 829c20f39eee95e7c98ff68861317212c4aed9d7 Mon Sep 17 00:00:00 2001 From: Twilight Sparkle Date: Wed, 3 Sep 2025 14:34:26 +0000 Subject: [PATCH 2/2] Mention the refresh token in the docs --- docs/topics/access-token.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/access-token.md b/docs/topics/access-token.md index 1d898cd89..16acc4a10 100644 --- a/docs/topics/access-token.md +++ b/docs/topics/access-token.md @@ -8,7 +8,7 @@ This can be run from anywhere, not necessarily from the host where MAS is runnin sh ./misc/device-code-grant.sh [synapse-url] ... ``` -This will prompt you to open a URL in your browser, finish the authentication flow, and print the access token. +This will prompt you to open a URL in your browser, finish the authentication flow, and print the access and refresh tokens. This can be used to get access to the MAS admin API: