Skip to main content

SocialCallbackFormDTO

Package: @nauth-toolkit/core Type: DTO (Request Body - Form)

Form DTO for Apple form_post OAuth callbacks. Apple uses POST with application/x-www-form-urlencoded instead of GET query parameters.

import { SocialCallbackFormDTO } from '@nauth-toolkit/nestjs';

Properties

PropertyTypeRequiredDescription
authuserstringNoGoogle account index. Sent by Google in some callback flows. Ignored by nauth.
codestringNoOAuth authorization code from provider. Max 2000 characters. Trimmed.
errorstringNoProvider error code (if user cancels or error occurs). Max 2000 characters. Trimmed.
error_descriptionstringNoProvider error description. Max 4000 characters. Trimmed.
hdstringNoHosted domain hint. Sent by Google for G Suite accounts. Ignored by nauth.
promptstringNoOAuth prompt parameter echo. Sent by some providers. Ignored by nauth.
scopestringNoGranted OAuth scopes returned by provider. Ignored by nauth.
statestringNoOAuth state parameter for CSRF protection. Max 500 characters. Trimmed.
userstringNoApple-specific JSON string with user name/email (first sign-in only). Parsed by Apple provider.

Example

POST /auth/social/apple/callback HTTP/1.1
Host: api.example.com
Content-Type: application/x-www-form-urlencoded

code=c1234567890abcdef&state=xyz789
Apple Form Post

Apple uses form_post response mode (POST instead of GET) when requesting name or email scopes. Ensure your backend parses application/x-www-form-urlencoded bodies. The user field (JSON string with name/email) is only sent by Apple on the first sign-in.

Used By