Herald
OpenapiOauth

Handle OAuth callback submitted as an HTML form (Apple `response_mode=form_post` sends the authorization response as a POST body instead of a redirect query). Same semantics as the GET variant.

POST
/api/oauth/{realmId}/{provider}/callback

Path Parameters

realmId*string

Realm ID

provider*string

OAuth provider type (form_post is used by Apple)

Request Body

Authorization response fields (code/state on success; error/error_description on denial), sent as form fields by response_mode=form_post

application/x-www-form-urlencoded
  1. body

Provider callback parameters. A successful authorization carries code + state; a denial (or provider error) carries error (+ optional error_description) with state per RFC 6749 §4.1.2.1 — both shapes land on the same endpoint, so every field except state is optional and the branch decision happens in the handler.

code?string|null
error?string|null
error_description?string|null
state?string|null

Response Body

OAuth login successful (or, with error=..., a friendly denial body)

application/json
  1. response
agreements?array<>|null
consentRequired?boolean|null
message*string
restrictedSession?null|
userId*string
accessToken*string
expiresIn*integer
Formatint64
Range0 <= value
refreshExpiresIn*integer
Formatint64
Range0 <= value
refreshToken*string
tokenType*string
Example Request
curl -X POST 'https://example.com/api/oauth/string/string/callback' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d ''
Example Response
{
  "agreements": [
    {
      "agreement_type": "string",
      "effective_at": "2019-08-24T14:15:22Z",
      "external_url": "string",
      "mode": "full_text",
      "summary": "string",
      "title": "string",
      "version_id": "9e94c502-ca41-4342-a7f7-af96b444512c",
      "version_no": 0
    }
  ],
  "consentRequired": true,
  "message": "string",
  "restrictedSession": null,
  "userId": "string"
}