OAuth apps
URL generator
Build an authorize URL and the matching token request without writing code
Fill in your app's details to get the URL that starts the sign-in, and the request your server makes once Ghost sends the person back. Everything is computed in your browser; nothing you type is sent anywhere.
Where Ghost's API answers, with https://
From your app's page under Settings → OAuth apps
Leave empty to use the app's first callback URL
Random per request. Check it comes back unchanged.
Secret. Store it server-side until the callback arrives.
1. Send the person to this URLOpen in a new tab
https://api.example.com/login/oauth/authorize?client_id=YOUR_CLIENT_ID&scope=repo2. Exchange the code from the callback, on your server
curl -X POST https://api.example.com/login/oauth/access_token \ -H "Accept: application/json" \ -d client_id=YOUR_CLIENT_ID \ -d client_secret="$GHOST_CLIENT_SECRET" \ -d code=CODE_FROM_THE_CALLBACKTrying it by hand
- Register an app under Settings → OAuth apps, and copy its client ID here.
- Open the URL in a browser where you are signed in to Ghost, and approve the app.
- Ghost redirects to your callback. If nothing listens there yet, copy the
codefrom the address bar of the page that fails to load. - Within 10 minutes, run the
curlcommand with that code and your client secret inGHOST_CLIENT_SECRET. A code works once, and a failed exchange uses it up.
See Authorizing users and Exchanging the code for what each parameter means.