Pinned source and discovery
The normative source is SEP-45 at commit0dc4592cb44dda1943341016f076e9326874daed. The standards baseline records the source digest and draft status.
From the selected Home Domain’s pinned SEP-1 response, discover and bind:
WEB_AUTH_FOR_CONTRACTS_ENDPOINTas the authentication endpoint;WEB_AUTH_CONTRACT_IDas the exact Web Authentication Contract;SIGNING_KEYas the classic Server Account;- the Home Domain and Web Auth Domain relationship;
- optional client-domain support and its discovered classic signing account;
- Stellar network passphrase, RPC origin, protocol version, and latest ledger.
Roles and supported accounts
SEP-45 supports contract accounts. SEP-10 supports classic
G... and muxed M... accounts. Test the two protocols side by side only when both are advertised; never send one protocol’s challenge format to the other endpoint or claim equivalent authorization semantics.
Safe fixture boundary
Use only released test-only contracts on a controlled local network or Stellar testnet deployment. The contracts release must publish source commit, interface/spec digest, WASM digest, deployment transaction, network passphrase, contract IDs, constructor inputs, and verification result as described in Contract documentation. Fixture contracts exercise explicit__check_auth policies without holding production assets. Signers and policy-wallet inputs are generated per run. No authorization entry is signed before structural validation, and no transaction is submitted; the client simulates the exact proposed invocation first.
Challenge request
Request a challenge for one validC... Client Account and explicit Home Domain. Add client_domain only for an approved controlled domain. Record request parameters, endpoint origin, response digest, ledger sequence, network, and fixture contract release.
Test malformed contract addresses, missing or unsupported home domains, unapproved client domains, rate limits, and repeated identical requests. Each successful request must contain a fresh nonce even when every request parameter is identical.
Decode authorization entries
Decode the returned XDR as the pinnedSorobanAuthorizationEntries type with strict byte, entry-count, nesting, string, and map limits. Reject trailing data, wrong XDR type, duplicate ambiguous map keys, invalid addresses, and unsupported credential forms.
Each entry must have one root contract-function invocation and no sub-invocations. Across every entry require:
contract_addressequals the discoveredWEB_AUTH_CONTRACT_ID;function_nameequalsweb_auth_verify;- the entire Symbol-to-String argument map is identical;
accountequals the requested Client Account;home_domainequals the selected Home Domain;web_auth_domainequals the bound server domain;web_auth_domain_accountequals the Server Account;nonceis nonempty, unique for the challenge, and identical across entries;- optional
client_domainandclient_domain_accountappear together and match pinned discovery.
Signatures and policy contracts
The fixture signer authorizes only the exact validated entry under the locked network passphrase and near-future signature-expiration ledger. A Client Account’s__check_auth may require one signature, multiple signatures, a policy wallet, or no conventional signature, so the expected credential shape comes from the released fixture contract and scenario.
Test successful and rejected fixture policies, missing signatures, wrong signer, modified payload, wrong network, unsupported credential type, insufficient policy approval, expired signature ledger, and excessive expiration. Client-domain signing is separate from Client Account authorization and must match the discovered domain account.
Signing proves only that the fixture contract’s selected auth policy accepted this invocation. It does not prove legal identity, account ownership outside the contract logic, custody security, or permission to move assets.
Simulate and inspect footprint
Construct a transaction containing one Invoke Host Function operation for the advertised Web Authentication Contract andweb_auth_verify, with the validated arguments and signed authorization entries. Simulate through the pinned RPC without submitting.
Simulation must succeed and the read-write footprint must contain only the allowed authentication state:
- nonce contract data for the Client Account;
- nonce contract data for the Server Account;
- optional nonce contract data for the Client Domain Account;
- optional contract-instance data for the Web Authentication Contract when its archived instance must be restored.
Token exchange and replay
Submit the signed entries only to the approved contract-auth endpoint using each encoding required by the pinned draft. The server must repeat contract/function/argument, nonce, participant, signature, and simulation verification before issuing a session JWT. Test these replay controls together:- nonce uniqueness for every challenge;
- atomic one-time nonce consumption at token exchange;
- rejection of old nonces;
- near-future client signature-expiration ledger;
- bounded server signature expiration or server-side rejection policy;
- no more than one JWT for one challenge.
Session token checks
Verify the JWT before trusting it. Require the pinned claims: expected issuer URI, exactC... subject, reasonable issued-at time, valid expiry, and optional exact client_domain only when that proof was performed. Restrict algorithms and keys, reject unknown critical headers and bad claim types, and record only redacted claims and a token digest.
Audience, token identifier, maximum lifetime, and downstream authorization checks are SECURITY or POLICY unless the pinned draft directly requires them. Never present those failures as normative SEP-45 violations without a source anchor.
Fixture contract set
A released test fixture bundle must include:- single-signature contract account;
- multisignature or threshold policy account;
- policy-wallet acceptance and rejection cases;
- account whose
__check_authneeds no conventional client signature; - valid Web Authentication Contract requiring client and server auth;
- optional client-domain variant;
- expired signature, replayed nonce, altered args, unexpected sub-invocation, and wrong-network cases;
- archived Web Authentication Contract instance restoration case for version 0.1.1;
- malicious contract attempting an unexpected footprint write.
testOnly, hash-verified, and deployed only to named fixture networks. The contract storage reference remains the boundary until such a release exists.
Classic comparison
Both protocols require domain/key discovery, server proof, network binding, independent JWT validation, bounded fixtures, and secret-free evidence. Passing one never implies passing the other.