-
Notifications
You must be signed in to change notification settings - Fork 389
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
MSC4254: Usage of RFC7009 Token Revocation for Matrix client logout #4254
base: main
Are you sure you want to change the base?
Conversation
7780b3b
to
bc25ec8
Compare
bc25ec8
to
ac1602f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice and simple: call revoke to revoke
MSCs proposed for Final Comment Period (FCP) should meet the requirements outlined in the checklist prior to being accepted into the spec. This checklist is a bit long, but aims to reduce the number of follow-on MSCs after a feature lands. SCT members: please check off things you check for, and raise a concern against FCP if the checklist is incomplete. If an item doesn't apply, prefer to check it rather than remove it. Unchecking items is encouraged where applicable. Checklist:
|
@mscbot fcp merge |
Team member @turt2live has proposed to merge this. The next step is review by the rest of the tagged people: Once at least 75% of reviewers approve (and there are no outstanding concerns), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for information about what commands tagged team members can give me. |
|
||
The server may return an error response as defined in [RFC7009]. The client should handle these errors appropriately: | ||
|
||
- If the token is already revoked, the server returns a 200 OK response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implication of this is that the server has to retain a record old tokens for at least some time, so that it can respond appropriately?
- If the token is already revoked, the server returns a 200 OK response | ||
- If the client is not authorized to revoke the token, the server returns a 401 Unauthorized response | ||
- For other errors, the server returns a 400 Bad Request response with error details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly should happen if the token is completely unrecognised? I feel like I could argue for any of 200, 401 or 400 given this description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From RFC7009:
The authorization server responds with HTTP status code 200 if the
token has been revoked successfully or if the client submitted an
invalid token.
So it should be status 200 for invalid tokens.
Maybe this change would clarify
- If the token is already revoked, the server returns a 200 OK response | |
- If the client is not authorized to revoke the token, the server returns a 401 Unauthorized response | |
- For other errors, the server returns a 400 Bad Request response with error details | |
- If the token is already revoked or invalid, the server returns a 200 OK response | |
- If the client is not authorized to revoke the token, the server returns a 401 Unauthorized response | |
- For other errors, the server returns a 400 Bad Request response with error details |
|
||
### Handling errors | ||
|
||
The server may return an error response as defined in [RFC7009]. The client should handle these errors appropriately: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we be explicit that the response is an RFC6749 error response rather than a Matrix error response?
The server may return an error response as defined in [RFC7009]. The client should handle these errors appropriately: | |
The server may return an error response as defined in [RFC7009]. Note that RFC7009 mandates a [RFC6749 error response](https://datatracker.ietf.org/doc/html/rfc6749#section-5.2) rather than a Matrix standard error response. | |
The client should handle these errors appropriately: |
|
||
The request includes: | ||
- The `token` parameter containing either the access token or refresh token to revoke | ||
- Optionally, the `token_type_hint` parameter, with either the `access_token` or `refresh_token` value. If provided, the server must use this value to determine which token to revoke |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't it say above that it revokes both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this specifies which type the token is, so if token
is an access token and you specified a refresh token hint, it won't work, but if you specified access token, the request will go through and both will be revoked
The request includes: | ||
- The `token` parameter containing either the access token or refresh token to revoke | ||
- Optionally, the `token_type_hint` parameter, with either the `access_token` or `refresh_token` value. If provided, the server must use this value to determine which token to revoke | ||
- The `client_id` obtained during client registration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So after consulting the auth room it makes sense to make client id optional for access tokens atleast. They are live without this information and therefore it makes sense to enable revokation without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically to allow revoking a leaked access token which could be used maliciously without a client id, making it harder to do the right thing than the bad thing.
Rendered
Implemented in
matrix-authentication-service
, Element X iOS and Android (through the matrix-rust-sdk) and Element WebIn line with matrix-org/matrix-spec#1700, the following disclosure applies:
I am a Software Engineer at Element. This proposal was written and published as an Element employee.
SCT stuff:
checklist
FCP tickyboxes