Skip to main content

Overview

SEP-10 (Stellar Web Authentication) enables wallet applications to create authenticated sessions with Stellar anchors by proving control over a Stellar account. Once authenticated, wallets receive a JSON Web Token (JWT) that they use in subsequent requests to the anchor’s standardized services. For the complete specification, see SEP-10: Stellar Web Authentication. The Anchor Platform implements SEP-10 with support for:
  • Challenge/Response Flow: GET /auth to request a challenge, POST /auth to validate and receive a JWT
  • Client Attribution: Optional verification of client application identity for noncustodial wallets
  • Custodial Wallet Support: Support for custodial wallets that manage user accounts
  • Multiple Home Domains: Support for multiple domains and wildcard patterns

Typical Authentication Flow

  1. The Client requests a unique challenge from the Server
  2. The Client verifies and signs the challenge
  3. The Client submits the signed challenge to the Server
  4. The Server verifies the challenge and responds with a JWT session token

Enable SEP-10

To enable SEP-10, set the following environment variables in your dev.env file.

Required Configuration (If Enabled)

The SIGNING_KEY in your stellar.toml file must be the public key derived from SECRET_SEP10_SIGNING_SEED. Wallets will verify that challenge transactions are signed by this key.

Optional Configuration

Multiple Home Domains: If you specify multiple home_domains (e.g., ap.stellar.org,*.sdp.stellar.org), you must also set SEP10_WEB_AUTH_DOMAIN to specify which domain hosts the authentication endpoint.

Client Attribution

Client attribution allows you to restrict authentication to specific wallet applications and verify their identity. This is an optional feature that should only be enabled if it’s a business requirement.
By default, the Anchor Platform allows anyone with a Stellar account to authenticate. Client attribution is only needed if you want to:
  • Restrict authentication to specific wallet applications
  • Verify the identity of noncustodial wallet applications
  • Track which wallet applications your users are using

Enabling Client Attribution

When SEP10_CLIENT_ATTRIBUTION_REQUIRED=true, noncustodial wallets must:
  1. Provide a client_domain parameter in the challenge request
  2. Sign the challenge transaction with the SIGNING_KEY from that domain’s stellar.toml file
  3. Have their domain listed in your client configuration

Client Configuration

Configure allowed clients in your YAML configuration file:
Or configure via environment variables:

Configure stellar.toml

Update your stellar.toml file to advertise SEP-10 support. Wallets discover your authentication endpoint through this file.
These fields should match the configuration options set in the Enable SEP-10 section above. WEB_AUTH_ENDPOINT - The URL where the authentication service is running. This is the URL that clients will use to authenticate with the anchor. The endpoint must support:
  • GET <WEB_AUTH_ENDPOINT> - Request a challenge
  • POST <WEB_AUTH_ENDPOINT> - Exchange signed challenge for session JWT
SIGNING_KEY - The public key corresponding to the private key specified in SECRET_SEP10_SIGNING_SEED. This key is used to sign authentication challenges presented to wallet applications.
  • SIGNING_KEY: Must be the public key derived from SECRET_SEP10_SIGNING_SEED
  • WEB_AUTH_ENDPOINT: Use https:// in production. The path /auth is the standard SEP-10 endpoint.
  • Host Matching: The host in WEB_AUTH_ENDPOINT should match one of your SEP10_HOME_DOMAINS (or the SEP10_WEB_AUTH_DOMAIN if specified).

How to Test the Authentication Flow

The SEP-10 authentication flow consists of two steps:
  1. GET /auth - Request a challenge transaction
    • Parameters: account (required), memo (optional), home_domain (optional), client_domain (optional)
    • Returns: A challenge transaction in XDR format
  2. POST /auth - Validate the signed challenge and receive a JWT
    • Body: { "transaction": "<signed_challenge_xdr>" }
    • Returns: { "token": "<jwt_token>" }
The JWT token should be included in subsequent API requests as a Bearer token in the Authorization header.
Testing Your Configuration: You can test SEP-10 authentication using curl and Stellar CLI. For more information about Stellar CLI, see the Stellar CLI documentation.