Apple Sign In — native iOS
The iOS app receives an `identity_token` from Sign in with Apple and posts it here. The server verifies the JWT with Apple's public keys and issues Avycenna tokens. Apple only sends the user's name on the very first sign-in; pass it as `user_name`.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Payload from Sign in with Apple in the iOS app.
Response Body
application/json
application/json
curl -X POST "https://example.com/api/v1/auth/oauth/apple/native" \ -H "Content-Type: application/json" \ -d '{ "identity_token": "string" }'{ "access_token": "string", "refresh_token": "string", "token_type": "bearer", "user": { "id": "string", "name": "string", "email": "string", "image": "string", "role": "patient" }}{ "detail": [ { "loc": [ "string" ], "msg": "string", "type": "string" } ]}Apple Sign In — web callback POST
Apple form-posts here after consent. Verifies the identity token, upserts the user, then redirects to the web app with Avycenna tokens in the URL fragment.
Google OAuth — web redirect GET
Redirect the browser to Google's OAuth consent screen. After approval, Google redirects back to `/oauth/google/callback` which issues tokens and redirects to the app.