-
Notifications
You must be signed in to change notification settings - Fork 61
Add basic documentation for personal sessions #5187
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,6 +129,33 @@ It may also be used in the future as a foundation for a new Application Service | |
| This works by presenting the client credentials to get back an access token. | ||
| The simplest type of client credentials is a client ID and client secret pair, but MAS also supports client authentication with a JWT ([RFC 7523]), which is a robust way to authenticate clients without a shared secret. | ||
|
|
||
| ## Personal sessions (personal access tokens) | ||
|
|
||
| Personal access tokens are a credential that can be issued to give access to a user, | ||
| with predefined scopes and a predefined expiry time. | ||
| Either before or after expiry, the owner of the token can regenerate it, which produces a new | ||
| access token with the same scopes but a new expiry time. | ||
|
|
||
| Personal access tokens are intended to fulfill two basic use cases: | ||
|
|
||
| 1. an easy way to obtain a clean token for your own user, for use in automation and scripts; | ||
| 2. a way to obtain a token for administrative access of another user, either for ad-hoc administrative operations or to set up a bot or similar service. | ||
|
|
||
| In the future, users will be able to create their own personal access tokens, but this is currently not implemented | ||
| so (1) is currently not supported. | ||
|
|
||
| For now, personal access tokens must be created, regenerated and revoked by administrators through the [Admin API], satisfying use case (2). | ||
| [Element Admin](https://github.com/element-hq/element-admin), available by default in Element Server Suite, can be used to do this interactively. | ||
| You can also use the online beta deployment at [admin-beta.element.dev](https://admin-beta.element.dev/). <!--- TODO stable deployment --> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll bring up the stable deployment again tomorrow, fine with leaving the TODO for now |
||
|
|
||
| ### Validity | ||
|
|
||
| Personal sessions can be used so long as: | ||
|
|
||
| - the owner (creator) of the token is still an active and unlocked user (or static OAuth 2 client); and | ||
| - the actor (target user, or user being controlled by the token) has not been deactivated. Though the actor is allowed to be locked. | ||
|
|
||
|
|
||
| [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108 | ||
| [RFC 6749]: https://datatracker.ietf.org/doc/html/rfc6749 | ||
| [RFC 7523]: https://datatracker.ietf.org/doc/html/rfc7523 | ||
|
|
@@ -140,3 +167,4 @@ The simplest type of client credentials is a client ID and client secret pair, b | |
| [`urn:synapse:admin:*`]: ../reference/scopes.md#urnsynapseadmin | ||
| [`urn:mas:graphql:*`]: ../reference/scopes.md#urnmasgraphql | ||
| [`urn:mas:admin`]: ../reference/scopes.md#urnmasadmin | ||
| [Admin API]: ./admin-api.md | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.