Spanish Total.js
English
Documentation For AI agents
Contents

Check a provider with curl

Start a sign-in by hand to check the token, the extension and the address sent to the provider.

.md GitHub

Before you connect an app, you can check the setup from a terminal. You need an app token and a configured provider.

1. Start a sign-in:

curl -H "x-token: YOUR_APP_TOKEN" -H "Content-Type: application/json" \
  -d '{"serviceid":"facebook","sessionid":"test-1","url":"https://www.example.com/auth/"}' \
  https://auth.example.com/

OpenAuth answers with the sign-in address:

"https://auth.example.com/login/mwn8dxrxawfhtu3sc9/"

An error here points to the token or the serviceid. See Errors.

2. Ask the sign-in address where it sends the user, without following it:

curl -s -o /dev/null -D - https://auth.example.com/login/mwn8dxrxawfhtu3sc9/

3. Read the Location line. For Facebook it looks like this:

Location: https://graph.facebook.com/oauth/authorize?type=web_server&client_id=YOUR_APP_ID&redirect_uri=https%3A%2F%2Fauth.example.com%2Foauth%2Ffacebook%2F&scope=email&state=mwn8dxrxawfhtu3sc9

Check that:

  • client_id is the App ID you entered in OpenAuth.
  • redirect_uri is your public callback endpoint, with https://, exactly as you registered it at the provider.

4. To try the whole sign-in, open the sign-in address in a browser within 15 minutes, sign in, and read the profile with test-1:

curl -H "x-token: YOUR_APP_TOKEN" "https://auth.example.com/sessions/?id=test-1"
Made in Europe