Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

/_synapse/admin/v1/register ignores refresh_token #16641

Closed
cvwright opened this issue Nov 15, 2023 · 1 comment
Closed

/_synapse/admin/v1/register ignores refresh_token #16641

cvwright opened this issue Nov 15, 2023 · 1 comment
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@cvwright
Copy link
Contributor

Description

The admin API endpoint for registering users works almost just like the register client-server /register endpoint. However, it does not create a refreshable access token when one is requested.

The fix appears to be to change this call

result = await register._create_registration_details(user_id, body)

To something like this

should_issue_refresh_token = body.get("refresh_token", False)

result = await register._create_registration_details(user_id, body, should_issue_refresh_token=should_issue_refresh_token)

Steps to reproduce

  • Make up a new username and password
  • Get a nonce from GET /_synapse/admin/v1/register
  • Compute the mac for your username, password, and nonce
  • Send a request to POST /_synapse/admin/v1/register with valid username, password, nonce, and mac, and with refresh_token: true in the JSON body
  • Observe that there is no refresh_token or expires_in_ms in the response body

Homeserver

Circles dev homeserver

Synapse Version

1.94.0

Installation Method

Docker (matrixdotorg/synapse)

Database

single PostgreSQL server

Workers

Multiple workers

Platform

Debian 12.2 x86, AMD EPYC, Hetzner cloud

Configuration

No response

Relevant log output

n/a

Anything else that would be useful to know?

No response

@clokep clokep added S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Nov 20, 2023
@cvwright
Copy link
Contributor Author

Closed in #16642

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

2 participants