matrix-org / matrix-org/matrix-spec

Add a CS API to validate the user password

Open
#692 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Client-Server improvement
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

**Is your feature request related to a problem? Please describe.**

As a client application, I want to ask the user to confirm its password before doing an action.

For instance, the user has forgotten its PIN code which protect access to the application or has entered several wrong PIN code.

In this case, the app could reset the PIN code, but after asking for the account password. For the moment, the application simply log out the user, which is a bit rough.

Current API only allow to validate the password by login to the account, but it has the side effect to create a new deviceId, which is not expected at all.

**Describe the solution you'd like**

Add a client server authenticated API
```
POST /_matrix/client/r0/password
```

With body

```json
{
"password":"weakPassword"
}
```

and which will return 200 with empty Json in case of correct password, and 403 with a MatrixError in case of wrong password.

The API should be rate limited.

**Describe alternatives you've considered**

We should probably support all possible UIA flows, but not sure it is relevant for this use case, and not sure how we can implement that

**Additional context**

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing client-server password-validation/login API and the issue's UIA-flow alternative. Define the POST /_matrix/client/r0/password behavior, including successful and failed responses and rate limiting; it is done when the protocol specification clearly covers these cases without creating a new deviceId.

Written by the indexing model from the issue text.

Assessment

Domain
api, authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.