Skip to content

Instantly share code, notes, and snippets.

@lovelaced
Last active June 15, 2020 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lovelaced/d93da14d4b29665a1740aca6bc2328b7 to your computer and use it in GitHub Desktop.
Save lovelaced/d93da14d4b29665a1740aca6bc2328b7 to your computer and use it in GitHub Desktop.
Logging into matrix via curl
#!/bin/bash
MATRIX_SERVER="$2"
USER="$3"
PASSWORD="$4"
curl -XGET "https://$MATRIX_SERVER/_matrix/client/r0/login"
curl -XPOST -d '{"type":"m.login.password", "user":"$USER", "password":"$PASSWORD}' "https://$MATRIX_SERVER/_matrix/client/r0/login"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment