Login With MetaMask

The "Login With MetaMask" authentication method enables users to log in securely using their MetaMask wallet. Follow the instructions below to integrate this authentication method.

Overview

Endpoint

Request Body

{
  "signature": "0x9d14c60a8f0efef896291aa5c8f230c5b8ac57e026ff4e6b6c0f3cc9e68b0b116d9d4ec6b7c8b8daa6487c47850a64f87bfdb01c95f3a7e6a1c7ea029771d1f1c",
  "address": "0x8e9DD3c1Db3254d968967CbC367542C343273629"
}
  • signature: MetaMask wallet signature.

  • address: User's Ethereum wallet address.

Responses

Success (Code 200)

{
  "access": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expires": "2020-05-12T16:18:04.793Z"
  },
  "refresh": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expires": "2020-05-12T16:18:04.793Z"
  }
}
  • access: Access token for authentication.

  • expires: Expiry date and time for the access token.

  • refresh: Refresh token for obtaining a new access token.

Auth Failed (Code 400)

  • Media Type: application/json

  • Example Value: An error response indicating that authentication has failed.

Not Found (Code 404)

  • Media Type: application/json

  • Example Value: An error response indicating that the Nonce has not been found.

Internal Server Error (Code 500)

  • Media Type: application/json

  • Example Value: An error response indicating an internal server error.

Usage

  1. Send a POST request to the provided endpoint with the required information.

  2. Handle the response accordingly based on success, authentication failure, or nonce not found.

Note: Ensure the MetaMask wallet signature (signature) and wallet address (address) are valid.

Last updated