Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain the rationale for /account/password authentication (SPEC-407) #680

Closed
matrixbot opened this issue May 29, 2016 · 0 comments · Fixed by #2027
Closed

Explain the rationale for /account/password authentication (SPEC-407) #680

matrixbot opened this issue May 29, 2016 · 0 comments · Fixed by #2027
Assignees
Labels
clarification An area where the spec could do with being more explicit client-server Client-Server API p4

Comments

@matrixbot
Copy link
Member

The C-S API's password change endpoint (POST /account/password) uses user-interactive authentication, but also mentions that an access token may be provided if there is an active session.

I chatted with Dave about this in #matrix-dev, and we covered a few things that could be clarified here:

Why is U-I auth used when an access token would prove who you are?

To be extra safe in ensuring that the password change request is coming from the real owner of the account, sort of like how services like GitHub make you reauthenticate with your password when you do certain "dangerous" actions. (I believe GitHub calls this "sudo mode.")

If you have to use U-I auth, what is the purpose of also passing in an access token?

So your active session can stay logged in even though the password changed. Other access tokens get revoked when the password is changed. So the access token as input to this API really means "expire all my access tokens except this one." The spec should explain that.

Why bother keeping the one supplied access token valid rather than just revoking all of them and having the client reauthenticate? It already knows the new password, and it should already handle access token refreshing, as described by the client authentication section of the spec in general.

Because clients (read: Vector) don't actually do this right now. If your current session's access token was revoked, Vector would log you out, not automatically log you in for a seamless experience. Maybe logging you out would actually be a good user experience, to make it super clear to the user that previous sessions using the old password have been ended. The client knows what password you submitted during the change request, so it could populate the login form and make it easy to log back in manually.

(Imported from https://matrix.org/jira/browse/SPEC-407)

(Reported by Jimmy Cuadra)

@matrixbot matrixbot added clarification An area where the spec could do with being more explicit p4 labels Oct 28, 2016
@matrixbot matrixbot changed the title Explain the rationale for /account/password authentication Explain the rationale for /account/password authentication (SPEC-407) Oct 31, 2016
@matrixbot matrixbot added the improvement A suggestion for a relatively simple improvement to the protocol label Nov 7, 2016
@richvdh richvdh removed the improvement A suggestion for a relatively simple improvement to the protocol label Oct 13, 2017
@turt2live turt2live added the client-server Client-Server API label Sep 6, 2018
@turt2live turt2live self-assigned this May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification An area where the spec could do with being more explicit client-server Client-Server API p4
Projects
None yet
3 participants