Skip to main content
POST
Create Auth Session

Create Auth Session

Create a just-in-time (JIT) authentication session. This returns a URL to redirect the user to for OAuth authorization.

Request

Body Parameters

user_id
string
required
Your user’s unique identifier
provider
string
required
OAuth provider to authenticate with. Currently supported: google

Response

session_id
string
Unique identifier for this auth session - use for polling status
auth_url
string
URL to redirect the user to for OAuth authorization
expires_at
string
ISO timestamp when this session expires (typically 5 minutes)

Example Response

Flow

  1. Call this endpoint to get an auth_url
  2. Redirect user to auth_url (or open in popup/new tab)
  3. User authorizes in Google
  4. Google redirects to MCP Rank’s callback
  5. MCP Rank stores tokens server-side
  6. Poll /v1/identity/sessions/{session_id} for completion
  7. Once complete, proxy requests will work

Example Flow

Notes

  • Sessions expire after 5 minutes
  • After successful auth, tokens are stored server-side (KMS encrypted)
  • The same user_id can have multiple providers connected