FoPost LogoFoPost Docs
Authentication

OAuth Flow

How FoPost manages platform OAuth authentication.

OAuth Flow

OwlStack manages OAuth authentication for all platforms on the server side. You connect platforms through the dashboard, and OwlStack handles token exchange, storage, and refresh automatically.

How it works

sequenceDiagram
    participant User as You
    participant Dash as OwlStack Dashboard
    participant Cloud as api.owlstack.app
    participant Platform as Twitter / LinkedIn / etc.

    User->>Dash: Click "Connect Twitter"
    Dash->>Cloud: Initiate OAuth flow
    Cloud->>Platform: Redirect to authorization page
    Platform->>User: "Authorize OwlStack?"
    User->>Platform: Approve
    Platform->>Cloud: OAuth callback with code
    Cloud->>Platform: Exchange code for tokens
    Platform-->>Cloud: Access + Refresh tokens
    Cloud->>Cloud: Store encrypted tokens
    Cloud-->>Dash: "Twitter connected"

What OwlStack handles

  • Token exchange - converting authorization codes to access tokens
  • Secure storage - tokens are encrypted at rest
  • Automatic refresh - tokens are refreshed before they expire
  • Scope management - requesting the right permissions for each platform

You never touch tokens

In the SaaS model, your code only needs an OwlStack API key:

$client = new OwlStackClient(apiKey: env('OWLSTACK_API_KEY'));
$client->publish($post, [Platform::Twitter]);
// OwlStack uses the stored OAuth tokens automatically

See API Keys for managing your OwlStack API key, and Platform Credentials for the pass-per-request alternative.

On this page