API template library

Facebook Login mock API and live sandbox

A WireMock simulation of Facebook's REST API — covering the login dialog, access-token exchange, and the Graph profile endpoint.

Vendor
Facebook
Functionality
OAuth login and profile
Spec version
22.0
Endpoints
4
Stubs
5
Protocol
REST
Validation
AI-validated Before publication, an AI agent exercised these endpoints against the real Facebook API through WireMock's recording proxy, and the recorded traffic was used to verify each stub's request and response shapes.

Live sandbox · no signup, no API key

Facebook Sign-in Mock

A running WireMock Cloud instance of this template, callable right now from a terminal, a script, or an AI agent.

Base URL
https://vkv97.wiremockapi.cloud

GET Landing page

curl -s -X GET 'https://vkv97.wiremockapi.cloud/'

GET Login page (Authorize endpoint)

curl -s -X GET 'https://vkv97.wiremockapi.cloud/dialog/oauth'
Method Path Summary
GET /dialog/oauth Authorization Endpoint
GET /me Get Current User
GET /oauth/access_token Access Token Endpoint (GET)
POST /oauth/access_token Access Token Endpoint

Unauthenticated WireMock Cloud demo sandbox for Facebook — not an official Facebook sandbox, and it returns simulated example data only.

What's inside the Facebook template

The mechanism worth knowing about: identity travels inside the token. The exchange endpoint mints an EAA-prefixed string — Facebook's token format — with the mock user's profile encoded in it, and /me decodes that string back into Graph fields: numeric id, name split into first and last, email, and a picture object down to the is_silhouette flag. The round trip means the profile your code reads is provably the one the login issued.

  • Login dialog — /dialog/oauth serving a clickable Facebook-styled sign-in screen
  • Token exchange — the access_token endpoint trading an authorization code for a long-lived bearer token
  • Graph profile — /me unpacking the token into the standard user-node fields
  • Form handler — the login POST that 302s back to your app with code and state intact

Frequently asked questions

In the access_token query parameter — the Graph API's original convention, and the only place this stub looks. Requests that put the token in an Authorization header alone won't resolve, so configure your Graph client the classic way when aiming it here.

Because the endpoint genuinely decodes what you hand it. Only strings minted by the exchange endpoint carry the encoded profile; an arbitrary value has nothing to unpack and currently surfaces as a 500 rather than a polite OAuthException. Run the exchange first and thread its output through — the flow order real Facebook Login enforces anyway.

expires_in comes back at roughly sixty days, matching Facebook's long-lived user tokens rather than the two-hour short-lived kind. Expiry bookkeeping — storing the deadline, scheduling a refresh — gets a realistic number to chew on, though the mock itself never actually expires anything.

POST. Facebook's docs describe fetching the token with a GET, and the template's spec lists that variant, but the live stub matches the POST form only. Beyond that, coverage stops at login: feed, friends, and the rest of the Graph belong in a private copy where you define the nodes your app touches.

Vendor names identify APIs represented by WireMock template sources. This page does not imply vendor endorsement, certification, partnership, or official integration status.