Login

The authentication process for the Social Service involves interacting with the Matrix server, used under the hood for the private chat subsystem. Users must log in to Matrix using their address, signing a fetch operation to obtain an authentication token. This token is then used to authorize interactions with the Social Service.

HTTP Request

To acquire the authentication token, as the Matrix documentation refers, a POST request must be made to the following URL: https://social.decentraland.org/_matrix/client/r0/login as in the example below.

To login into Matrix, you need to create and sign a message with AuthChain.

Request Body

{
  "auth_chain": authChain,
  "identifier": {
    "type": "m.id.user",
    "user": address
  },
  "timestamp": timestamp.toString(),
  "type": "m.login.decentraland"
}

Response Body

{
  "user_id": "@0x123abC:decentraland.org",
  "social_user_id": "0x123abC",
  "access_token": "syt_SomETokEN",
  "device_id": "FRFREGRG",
  "home_server": "decentraland.org",
  "well_known": {
      "m.homeserver": {
          "base_url": "https://synapse.decentraland.org/"
      }
  }
}

The authentication token, present in the access_token field, is required for subsequent interactions with the Social Service.

JS Code Example

Code from social-rpc-client-js

Last updated