Docs / API: Account
Finish wallet sign-in
Checks the ed25519 signature. If it matches, the reply sets an HttpOnly session cookie that lasts seven days.
POST/api/v1/auth/verify
| Property | Value |
|---|---|
| Authentication | Not needed. |
| Rate-limit cost | 1 unit |
| Status | Live |
#Request body
JSON
{
"address": "BASE58_WALLET_ADDRESS",
"nonce": "NONCE_FROM_CHALLENGE",
"signature": "BASE64_OR_BASE58_SIGNATURE"
}#Request
curl -s -X POST "https://farbeamlabs.com/api/v1/auth/verify" \
-H "content-type: application/json" \
-d '{"address": "BASE58_WALLET_ADDRESS", "nonce": "NONCE_FROM_CHALLENGE", "signature": "BASE64_OR_BASE58_SIGNATURE"}'const res = await fetch("https://farbeamlabs.com/api/v1/auth/verify", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"address": "BASE58_WALLET_ADDRESS", "nonce": "NONCE_FROM_CHALLENGE", "signature": "BASE64_OR_BASE58_SIGNATURE"})
});
const { data, meta, error } = await res.json();
if (error) throw new Error(`${error.code}: ${error.message}`);
console.log(data);import os, requests
res = requests.post(
"https://farbeamlabs.com/api/v1/auth/verify",
json={'address': 'BASE58_WALLET_ADDRESS', 'nonce': 'NONCE_FROM_CHALLENGE', 'signature': 'BASE64_OR_BASE58_SIGNATURE'},
timeout=30,
)
body = res.json()
if "error" in body:
raise RuntimeError(body["error"]["code"])
print(body["data"])#Errors
| HTTP | Code | Meaning |
|---|---|---|
| 401 | invalid_challenge | The sign-in request expired, was used or does not match. |
| 401 | invalid_signature | The signature does not match the wallet and message. |
All errors share one format. See errors.