Auth

Exchange a one-time SSO code for the identity

Consumes a `pid_code` issued by a Google or passkey login with `returnTo` (optionally bound to a `clientId`) and returns the PeridotID identity. Codes are single-use and expire after ~5 minutes. Call server-to-server; when the code is bound to an app, the same `clientId` must be presented.

POST
/auth/exchange

Consumes a pid_code issued by a Google or passkey login with returnTo (optionally bound to a clientId) and returns the PeridotID identity. Codes are single-use and expire after ~5 minutes. Call server-to-server; when the code is bound to an app, the same clientId must be presented.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/auth/exchange" \  -H "Content-Type: application/json" \  -d '{    "code": "mF8xQ2vT9nR4kL7pZ3wX6yA1bD5eF0gH",    "clientId": "pidapp_0123456789abcdef0123456789abcdef"  }'
{  "pid": "ifal@pid",  "identityId": "ifal@pid",  "profile": {    "displayName": "string",    "avatarUrl": "string"  },  "credentials": [    {      "provider": "string",      "email": "string"    }  ]}