Skip to main content
POST
/
challenge
/
verify
/
solana
Verify Solana challenge
curl --request POST \
  --url https://authapi.moralis.io/challenge/verify/solana \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "message": "defi.finance wants you to sign in with your Solana account:\n26qv4GCcx98RihuK3c4T6ozB3J7L6VwCuFVc7Ta2A3Uo\n\nI am a third party API\n\nURI: http://defi.finance\nVersion: 1\nNetwork: mainnet\nNonce: PYxxb9msdjVXsMQ9x\nIssued At: 2022-08-25T11:02:34.097Z\nExpiration Time: 2022-08-25T11:12:38.243Z\nResources:\n- https://docs.moralis.io/",
  "signature": "2pH9DqD5rve2qV4yBDshcAjWd2y8TqMx8BPb7f3KoNnuLEhE5JwjruYi4jaFaD4HN6wriLz2Vdr32kRBAJmHcyny"
}
'
{
  "id": "fRyt67D3eRss3RrX",
  "domain": "defi.finance",
  "uri": "https://defi.finance/",
  "version": "1.0",
  "nonce": "0x1234567890abcdef0123456789abcdef1234567890abcdef",
  "profileId": "0xbfbcfab169c67072ff418133124480fea02175f1402aaa497daa4fd09026b0e1",
  "network": "mainnet",
  "address": "26qv4GCcx98RihuK3c4T6ozB3J7L6VwCuFVc7Ta2A3Uo",
  "statement": "Please confirm",
  "expirationTime": "2020-01-01T00:00:00.000Z",
  "notBefore": "2020-01-01T00:00:00.000Z",
  "resources": [
    "https://docs.moralis.io/"
  ]
}

Authorizations

X-API-Key
string
header
required

Body

application/json

Verify Solana challenge message.

message
string
required

Message that needs to be signed by the end user

Example:

"defi.finance wants you to sign in with your Solana account:\n26qv4GCcx98RihuK3c4T6ozB3J7L6VwCuFVc7Ta2A3Uo\n\nI am a third party API\n\nURI: http://defi.finance\nVersion: 1\nNetwork: mainnet\nNonce: PYxxb9msdjVXsMQ9x\nIssued At: 2022-08-25T11:02:34.097Z\nExpiration Time: 2022-08-25T11:12:38.243Z\nResources:\n- https://docs.moralis.io/"

signature
string
required

Base58 signature that needs to be used to verify end user

Example:

"2pH9DqD5rve2qV4yBDshcAjWd2y8TqMx8BPb7f3KoNnuLEhE5JwjruYi4jaFaD4HN6wriLz2Vdr32kRBAJmHcyny"

Response

201 - application/json

The token to be used to call the third party API from the client

id
string
required

17-characters Alphanumeric string Secret Challenge ID used to identify this particular request. Is should be used at the backend of the calling service to identify the completed request.

Required string length: 8 - 64
Example:

"fRyt67D3eRss3RrX"

domain
string<hostname>
required

RFC 4501 dns authority that is requesting the signing.

Example:

"defi.finance"

uri
string<uri>
required

RFC 3986 URI referring to the resource that is the subject of the signing (as in the subject of a claim).

Example:

"https://defi.finance/"

version
string
required

EIP-155 Chain ID to which the session is bound, and the network where Contract Accounts must be resolved.

Example:

"1.0"

nonce
string
required
Example:

"0x1234567890abcdef0123456789abcdef1234567890abcdef"

profileId
string
required

Unique identifier with a length of 66 characters

Example:

"0xbfbcfab169c67072ff418133124480fea02175f1402aaa497daa4fd09026b0e1"

network
enum<string>
required

The network where Contract Accounts must be resolved.

Available options:
mainnet,
testnet,
devnet
Example:

"mainnet"

address
string
required

Solana address with a length of 32 - 44 characters that is used to perform the signing

Example:

"26qv4GCcx98RihuK3c4T6ozB3J7L6VwCuFVc7Ta2A3Uo"

statement
string

Human-readable ASCII assertion that the user will sign, and it must not contain .

Example:

"Please confirm"

expirationTime
string<date-time>

ISO 8601 datetime string that, if present, indicates when the signed authentication message is no longer valid.

Example:

"2020-01-01T00:00:00.000Z"

notBefore
string<date-time>

ISO 8601 datetime string that, if present, indicates when the signed authentication message will become valid.

Example:

"2020-01-01T00:00:00.000Z"

resources
string[]

List of information or references to information the user wishes to have resolved as part of authentication by the relying party. They are expressed as RFC 3986 URIs separated by `

  • `.
Example:
["https://docs.moralis.io/"]