Skip to main content
This feature is experimental and may change without notice in future releases.
Placet can act as an OAuth relay, allowing connected agents to initiate OAuth authorization flows that involve the end user — without the agent needing direct browser access. This is useful when an agent needs the user to authorize a third-party service (e.g., GitHub, Google, Slack) and the agent runs headlessly behind Placet.

Supported Flows

Authorization Code + PKCE

The agent generates a PKCE challenge and constructs the authorization URL with Placet’s callback as the redirect_uri. The user clicks the link in the Placet UI, authorizes the app, and the OAuth provider redirects back to Placet. Placet then relays the authorization code to the agent via Socket.IO. Security: The PKCE verifier never leaves the agent. Placet only sees the authorization code (which is useless without the verifier).

Device Code

The agent initiates a device code flow with the OAuth provider and sends the verification URL + user code to the user via Placet. The user opens the URL and enters the code. The agent polls the token endpoint directly.

How It Works

Callback URL

The OAuth callback endpoint is:
Use this as the redirect_uri when constructing authorization URLs for the Authorization Code flow.

Socket.IO Events

oauth:start (agent → server)

Emitted by the agent to initiate an OAuth flow. The server registers the state for callback resolution and forwards the event to the user’s frontend.

oauth:code (server → agent)

Emitted to the agent’s channel when the OAuth callback receives an authorization code.

oauth:error (server → agent)

Emitted when the OAuth provider returns an error to the callback.

oauth:start (server → frontend)

Forwarded to the user’s frontend session to display the authorization link or device code.

State Management

  • Each oauth:start event registers the state parameter in an in-memory store with a 10-minute TTL.
  • The state is consumed (single-use) when the callback arrives.
  • Expired or unknown states return an error page to the user.

Example: Agent Integration (TypeScript)