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($challenge: String!, $signature: String!, $signer: String!, $chainId: Int!, $orgId: UUID1!) {
  loginWithSignature(
    request: {challenge: $challenge, signature: $signature, signer: $signer, chainID: $chainId}
    orgID: $orgId
  ) {
    token
    tokenType
    __typename
  }
}

Sample Variables

{
  "orgId": "0db10bbf-85fe-4c87-911b-d18f8568fc07",
  "signer": "DWtAGjRsXghPAynsG6QyjkvwbGGcdm4PSnW7xx3Sud7d",
  "challenge": "This message is used for signature validation for organization dvin-labs and wallet address DWtAGjRsXghPAynsG6QyjkvwbGGcdm4PSnW7xx3Sud7d at 2025-01-17T07:12:50Z",
  "signature": "4neyxSXkfhEy5nSaUpGF6snYW4WdiGJ4R3PgeVYwb8nxtrL1MKNHwGEzUmwiFN4FjPndJZvpY9jPbwAJe6xRRR6Z",
  "chainId": 901
}

Sample Response

{
  "data": {
    "loginWithSignature": {
      "token": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFkbWluIn0.eyJhdWQiOlsiMGRiMTBiYmYtODVmZS00Yzg3LTkxMWItZDE4Zjg1NjhmYzA3Il0sImV4cCI6MTczNzEwNTE4MywiaXNzIjoiaHR0cHM6Ly9hcGkubW9qaXRvLnh5eiIsIm5iZiI6MTczNzA5Nzk4Mywic3ViIjoiRFd0QUdqUnNYZ2hQQXluc0c2UXlqa3Z3YkdHY2RtNFBTblc3eHgzU3VkN2QifQ.riLpb7Ecd2nt4t2XP4ZeyMLj0ps-zCNFtyabYoX_IhggQFgr5SM29k2Q1z83cJ_KYTZ-HDRyNH7i9UHXujzKzg",
      "tokenType": "Bearer",
      "__typename": "SignInResponse"
    }
  }
}

Arguments

Name

Type

Description

Required

orgId

UUID1

This 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

signer

EVM compatible Wallet Address

Note 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

chainID

UUID1

This 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

challenge

UUID1

This is a message available from the response field of getSignatureMessage Query

Yes

signature

UUID1

This is a signature signed from a crypto wallet.

Yes