v1

latestOpenAPI 3.1.02026-07-13570316.1 KB
Authentication

Social Auth

Complete OAuth authentication with social providers in a single step. Unlike other auth methods that require separate initiate/complete calls, OAuth is handled entirely through redirects.

OAuth Flow (Self-Contained):

  1. Redirect your user to this endpoint with provider and redirectUrl
  2. User completes OAuth flow with the provider
  3. User is redirected back to your redirectUrl with wallet credentials

Why OAuth is different: OAuth providers handle the challenge/response flow externally, so no separate /complete step is needed.

Example: Redirect user to: GET /v1/auth/social?provider=google&redirectUrl=https://myapp.com/auth/callback

Callback Handling: After OAuth completion, user arrives at your redirectUrl with an authResult query parameter:

https://myapp.com/auth/callback?authResult=%7B%22storedToken%22%3A%7B%22authDetails%22%3A%7B...%7D%2C%22cookieString%22%3A%22eyJ...%22%7D%7D

Extract JWT token in your callback:

// Parse the authResult from URL
const urlParams = new URLSearchParams(window.location.search);
const authResultString = urlParams.get('authResult');
const authResult = JSON.parse(authResultString!);

// Extract the JWT token
const token = authResult.storedToken.cookieString;

Verify and use the JWT token:

// Use the JWT token for authenticated requests
fetch('/v1/wallets/me', {
  headers: { 
    'Authorization': 'Bearer ' + token,
    'x-secret-key': 'your-secret-key'
  }
})
.then(response => response.json())
.then(data => {
  console.log('Wallet verified:', data.result.address);
  console.log('Auth profiles:', data.result.profiles);
});

Authentication Options: Choose one of two ways to provide your client credentials:

Option 1: Query Parameter (Recommended for OAuth flows)

GET /v1/auth/social?provider=google&redirectUrl=https://myapp.com/callback&clientId=your_client_id

Option 2: Header (Alternative)

GET /v1/auth/social?provider=google&redirectUrl=https://myapp.com/callback
Headers: x-client-id: your_client_id
get/v1/auth/social

Query parameters

provider'google' | 'apple' | 'facebook' | 'discord' | 'farcaster' | 'telegram' | 'line' | 'x' | 'coinbase' | 'github' | 'twitch' | 'steam' | 'tiktok' | 'epic' required

The OAuth provider to use

The OAuth provider to use

redirectUrlstring uri required

URL to redirect the user to after OAuth completion

URL to redirect the user to after OAuth completion

clientIdstring

Client ID (alternative to x-client-id header for standard OAuth flows)

Client ID (alternative to x-client-id header for standard OAuth flows)

ecosystemIdstring

Ecosystem wallet ID (e.g. ecosystem.myapp). Required for ecosystem wallet OAuth so the minted auth token carries the ecosystem.

Ecosystem wallet ID (e.g. ecosystem.myapp). Required for ecosystem wallet OAuth so the minted auth token carries the ecosystem.

ecosystemPartnerIdstring

Ecosystem partner ID associated with the ecosystem wallet OAuth login.

Ecosystem partner ID associated with the ecosystem wallet OAuth login.