arrow_back API Documentation

Login with PlanetGraph

Turn every sign-up and login into richer context for your product.

Instead of starting with a blank profile, your app can connect to a living graph of people where PlanetGraph records relationships for future insights.

How It Works

  1. Your app redirects the user to https://planetgraph.ai/login_with?app_id=YOUR_APP_UUID&state=YOUR_STATE.
  2. The user signs up or logs in using their preferred provider.
  3. PlanetGraph fetches all the information it has on the user, subject to access policies, and links your app to the user.
  4. PlanetGraph redirects back to your specified callback URL with rich information on the user.

You may use Login with PlanetGraph to augment your product's own user database or as a complete replacement.

Managing Apps

Create and review Login with PlanetGraph apps from the app dashboard. App definitions are graph nodes, so they can also be managed through the graph API.

apps My Apps

App Node Properties

PropertyRequiredDescription
nameYesDisplay name shown on the Login with PlanetGraph page.
descriptionNoShort app description shown to the user before login.
logo_urlNoURL for the app logo displayed on the login page.
auth_methodsNoAllowed methods such as email, Google, and GitHub. Defaults to all methods.
permissionsNoRequested data permissions for the app.
callback_urlYesURL on your server that reveis the login result

Callback

After a successful login, PlanetGraph redirects the user's browser to your app's callback_url with an HTTP GET request. The callback data is sent as URL query parameters; no request body is sent.

If your callback URL already has query parameters, PlanetGraph preserves them and appends the login result parameters.

The optional state value is generated by your app before redirecting to PlanetGraph. PlanetGraph returns the same value in both the callback query string and signed token so your server can match the callback to the browser session that started the login.

Query ParameterDescription
person_idUUID of the PlanetGraph Person node for the authenticated user.
app_idUUID of your PlanetGraph app node.
login_idUUID of the logged_into edge for this login event.
auth_methodAuthentication method used for this login.
stateOptional value supplied by your app and returned unchanged for callback/session matching.
login_tokenShort-lived signed token your server should verify before trusting the callback.

Security

Every callback includes a short-lived signed login_token. The token binds the Person ID, App ID, login ID, auth method, optional state, issue time, and expiration time to the callback so your server can confirm the login result came from PlanetGraph before trusting it.

Your callback handler should read the login_token and state from the callback query string, verify the token server-side, and confirm the returned state matches the browser session that initiated login before creating a session or updating local user data.

POST/api/v1/login-with/callback-token/verify

Submit the login_token to verify the signature and expiration, then use the verified payload returned by PlanetGraph.

Endpoints

GET/api/v1/login-with/apps/{app_id}

Read public app metadata for the login page.

POST/api/v1/login-with/apps/{app_id}/complete

Complete an authenticated login and return the callback redirect URL.

POST/api/v1/login-with/callback-token/verify

Verify a signed callback token before trusting the login result.

GET/api/v1/login-with/apps

List apps owned by the current PlanetGraph account.

POST/api/v1/login-with/apps

Create an app node configured for Login with PlanetGraph.