Avycenna

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`.

POST
/api/v1/auth/oauth/apple/native

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"    }  ]}