Matrix-accounts: Difference between revisions

From Irregularpedia
Jump to navigation Jump to search
Initial
 
categories, formatting
Tag: 2017 source edit
Line 1: Line 1:
<span id="matrix-account-management"></span>
= Matrix Account Management =
= Matrix Account Management =


Return to [[matrix-server-guide|Matrix Server Guide]]
Return to [[Matrix Server Guide]]


https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/registering-users.md
For comprehensive details, refer to the official documentation:
* [https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/registering-users.md Registering Users Guide]
* [https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/9f5d4018c7deff00e29d9b5846b9de028f1bc084/docs/obtaining-access-tokens.md Obtaining Access Tokens Guide]


<span id="create-account"></span>
<span id="create-account"></span>
== Create Account ==
== Create Account ==


<syntaxhighlight lang="shell">ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=drok password=changemenowplease admin=yes' --tags=register-user</syntaxhighlight>
To create a new Matrix user account with Ansible, use the following command:
 
<pre>
ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=usernamehere password=changemenowplease admin=yes' --tags=register-user
</pre>
 
* Replace `usernamehere` with the desired username.
* Replace `changemenowplease` with a strong, unique password.
* Add `admin=yes` if the account should have administrative privileges.
 
<span id="access-token"></span>
<span id="access-token"></span>
== Access Token ==
== Access Token ==


https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/9f5d4018c7deff00e29d9b5846b9de028f1bc084/docs/obtaining-access-tokens.md#L1
To obtain an access token for a Matrix user, follow this process:


<syntaxhighlight lang="shell">curl -XPOST -d '{
<pre>
curl -XPOST -d '{
     "identifier": { "type": "m.id.user", "user": "USERNAME" },
     "identifier": { "type": "m.id.user", "user": "USERNAME" },
     "password": "PASSWORD",
     "password": "PASSWORD",
     "type": "m.login.password",
     "type": "m.login.password",
     "device_id": "YOURDEVICEID"
     "device_id": "YOURDEVICEID"
}' 'https://matrix.YOURDOMAIN/_matrix/client/r0/login'</syntaxhighlight>
}' 'https://matrix.YOURDOMAIN/_matrix/client/r0/login'
</pre>
 
* Replace `USERNAME` with the Matrix username.
* Replace `PASSWORD` with the user's password.
* Replace `YOURDEVICEID` with the desired device ID (optional).
* Replace `YOURDOMAIN` with your Matrix server's domain name.
 
The response will include the access token, which can be used for authentication in scripts or bots.
 
[[Category:Matrix]]
[[Category:Account Management]]
[[Category:Guides]]

Revision as of 12:56, 22 November 2024

Matrix Account Management

Return to Matrix Server Guide

For comprehensive details, refer to the official documentation:

Create Account

To create a new Matrix user account with Ansible, use the following command:

ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=usernamehere password=changemenowplease admin=yes' --tags=register-user
  • Replace `usernamehere` with the desired username.
  • Replace `changemenowplease` with a strong, unique password.
  • Add `admin=yes` if the account should have administrative privileges.

Access Token

To obtain an access token for a Matrix user, follow this process:

curl -XPOST -d '{
    "identifier": { "type": "m.id.user", "user": "USERNAME" },
    "password": "PASSWORD",
    "type": "m.login.password",
    "device_id": "YOURDEVICEID"
}' 'https://matrix.YOURDOMAIN/_matrix/client/r0/login'
  • Replace `USERNAME` with the Matrix username.
  • Replace `PASSWORD` with the user's password.
  • Replace `YOURDEVICEID` with the desired device ID (optional).
  • Replace `YOURDOMAIN` with your Matrix server's domain name.

The response will include the access token, which can be used for authentication in scripts or bots.