Challenge Response
Response from a SEP-10 challenge request.
The server returns this response when a client requests a challenge transaction for authentication. The response contains a base64-encoded XDR transaction envelope that the client must validate and sign.
The challenge transaction is a specially-constructed Stellar transaction that:
Has sequence number 0 (cannot be submitted to network)
Contains only ManageData operations (harmless metadata)
Is already signed by the server
Has time bounds to prevent replay attacks
Proves the server's identity through its signature
Workflow:
Client requests challenge via GET to WEB_AUTH_ENDPOINT
Server returns ChallengeResponse with transaction XDR
Client validates the challenge (critical security step)
Client signs the validated challenge
Client submits signed challenge back to server
Server returns JWT token
Example response JSON:
{
"transaction": "AAAAAgAAAADR...base64...==",
"network_passphrase": "Test SDF Network ; September 2015"
}Security considerations:
Always validate the challenge before signing (use WebAuth.validateChallenge())
Verify the server signature matches the stellar.toml SIGNING_KEY
Check time bounds are reasonable
Ensure all operations are ManageData type
See also: