loginWithSignature

This GraphQL mutation allows you to fetch the JWT token using the wallet address that you previously signed the signature with. Please note that the previous signature generated should be valid for 15 minutes only and can only be used with the corresponding generated signatures. Below are some sample requests and responses for you to refer to.

General Pattern

mutation loginWithSignature(
  $signature: String!
  $challenge: String!
  $signer: String!
  $orgID: UUID1!
  $chainID: Int!
) {
  loginWithSignature(
    orgID: $orgID
    request: {
      signature: $signature
      challenge: $challenge
      signer: $signer
      chainID: $chainID
    }
  ){
    token
    tokentype
  }
}


Sample Variables

{
  "orgID": "d086ea16-d40d-454c-84a4-64b5e940670a",
  "signer": "0xc7e893488a039a341d935959e52f86085976f865",
  "chainID": 11155111,
  "challenge": "This message is used for signature validation for organization pace-test and wallet address 0xC7e893488A039A341d935959E52f86085976F865 at 2023-04-26T22:21:49Z",
  "signature": "0x9f73f49cc2d77ee8978d07cb6dfa7ec10b0bc4e145ee480b911b46d9f8c66de93e22efbc7601b9a3fbc40ae3b5050c2f61717d655e08a88fe7febcdc410cc2721b"
}



Sample Response

{
  "data": {
    "loginWithSignature": {
      "token": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFkbWluIn0.eyJhdWQiOlsiZDQxOTFjMGEtODAyMC00YTZhLWJkYjktNDYxZDkyYjhjMmRlIl0sImV4cCI6MTY4NTA3NzY2NCwiaXNzIjoiaHR0cHM6Ly9hcGkubW9qaXRvLnh5eiIsIm5iZiI6MTY4NDk5MTI2NCwic3ViIjoiMHgzNTNiNTg0MDY0YzhkNjY2NGVlMGRkODMzMDU1NDNlYWYzMDQ3MmEyIn0.vrEOVfMFthilZcQUpv6h9m_yhtMtombst33noZxdDuV7fSQun-rslZxbuYF4zwiT4w4uChZY7sOeQEWwpQ_7NA",
      "tokenType": "Bearer"
    }
  }
}

Arguments

NameTypeDescriptionRequired
orgIdUUID1This is a unique client ID for the project you are working on with Mojito. Please obtain this from the Mojito Support Team.
Note that it is different for development and production environments.
Yes
signerEVM compatible Wallet AddressNote that an EVM compatible wallet address is mandatory for this process. Please ensure that the wallet address you provide is compatible with the Ethereum Virtual Machine.Yes
chainIDUUID1This is a unique chain ID that is available from the "chainID" response field in the "GetSupportedNetworks" query.
Please note that it should be a valid chain ID for the network.
Yes
challengeUUID1This is a message available from the response field of getSignatureMessage QueryYes
signatureUUID1This is a signature signed from a crypto wallet.Yes