---
title: "Social Auth"
method: GET
path: "/v1/auth/social"
tags: ["Authentication"]
---

# Social Auth

`GET /v1/auth/social`

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:**
```javascript
// 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:**
```javascript
// 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
```

## Query parameters

- `provider` 'google' | 'apple' | 'facebook' | 'discord' | 'farcaster' | 'telegram' | 'line' | 'x' | 'coinbase' | 'github' | 'twitch' | 'steam' | 'tiktok' | 'epic', required — The OAuth provider to use
- `redirectUrl` string, uri, required — URL to redirect the user to after OAuth completion
- `clientId` string — Client ID (alternative to x-client-id header for standard OAuth flows)
- `ecosystemId` string — Ecosystem wallet ID (e.g. `ecosystem.myapp`). Required for ecosystem wallet OAuth so the minted auth token carries the ecosystem.
- `ecosystemPartnerId` string — Ecosystem partner ID associated with the ecosystem wallet OAuth login.

## Other responses

- `302` — Redirects to OAuth provider for authentication
- `400` — Invalid request parameters

---

[API](https://skmtc.net/thirdweb/apis/thirdweb-api.md) · [All operations](https://skmtc.net/thirdweb/apis/thirdweb-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thirdweb/thirdweb-api/revisions/fb4cb67da1c7/schema)
