Overview
The Turnkey Auth Proxy is a managed, multi-tenant service that signs and forwards authentication requests to the Turnkey API on your behalf — no backend required for auth flows. It handles sub-organization creation, OTP (email/SMS), and OAuth login.- Host:
https://authproxy.turnkey.com - What it does: Validates origin, looks up your org’s proxy config, signs the request with a proxy-scoped API key, and forwards it to the Turnkey API.
- What it doesn’t do: It cannot authenticate users without their participation (OTP code entry, OAuth consent). It has no access to funds or broader org operations.
How it works
- Enable in Dashboard — Toggle Auth Proxy ON. Turnkey creates a proxy user and proxy API key, stored encrypted in your org’s auth proxy config.
- Configure allowed origins — Only browser requests from these origins may call the proxy (CORS + origin validation). Defaults to
*. Accepts exact URLs and wildcard subdomains such ashttps://*.myapp.com. - Your frontend calls the Auth Proxy — Pass your
X-Auth-Proxy-Config-Idheader with every request. - Proxy signs and forwards — The proxy decrypts your proxy key in-memory (per request only), signs the activity, and forwards it to the Turnkey API.
- Response returned — The proxy returns the result (e.g.,
organizationId,session) directly to your frontend.
Wildcards match subdomains only:
https://*.myapp.com matches
https://app.myapp.com but not https://myapp.com — add the bare domain as a
separate entry if you serve the app there too. Include the scheme exactly, and
ports must match as well.- Proxy keys are HPKE-encrypted inside Turnkey’s enclaves and decrypted per-request only, in-memory.
- Strict separation from Turnkey’s core backend — communicates via public API only.
- The Auth Proxy passes App Proofs through to the caller without verifying them. End-users (SDKs) are expected to perform App Proof verification. See Turnkey Verified.
Authentication & headers
- Auth Proxy Config Id (required) — identifies your org’s proxy config. Found in Dashboard → Embedded Wallets → Configuration.
- CORS & Origin — requests must originate from a whitelisted origin set in the dashboard.
Auth flows
OTP (email or SMS)
Used to authenticate users with a one-time code sent to their email or phone number. For a walkthrough of the user experience, see Email auth — User experience. Flow:-
Init OTP
POST /v1/otp_init_v2— Send an OTP code to the user’s email or phone. Returns anotpIdand anotpEncryptionTargetBundle.otpEncryptionTargetBundleis a TEE-signed bundle containing a target P-256 encryption key. The client uses it to encrypt the OTP code before submission, so the code is only decryptable inside the enclave. If you’re usingreact-wallet-kitthis is handled automatically — see the otp-auth/without-backend example. -
Verify OTP
POST /v1/otp_verify_v2— SubmitencryptedOtpBundlealong withotpId; encrypt the code and client public key on the client first. Returns averificationToken— a short-lived, enclave-signed token proving the user owns the contact. -
OTP Login
POST /v1/otp_login_v2— Exchange theverificationToken+ a clientpublicKey+clientSignaturefor a session JWT. The session is scoped to the sub-org matching the verified contact.clientSignaturemust be signed by the key you bound during verification. It covers a login message built from the token ID and the session public key, not the raw token. Use the SDK’s message builder and signing helper; see client signing.
verificationToken directly to Signup to create a new sub-org for a user who has already verified their contact via OTP — skipping a separate OTP round-trip on registration.
OAuth (OIDC providers — Google, Apple, etc.)
Used when your app receives an OIDC token directly from a provider like Google or Apple.- OAuth Login
POST /v1/oauth_login— Submit theoidcTokenand a clientpublicKey. Returns a session JWT for the sub-org that has a matching OAuth provider (iss,sub,aud).
OAuth (OAuth 2.0-only providers — Discord, X/Twitter, etc.)
Used for providers that don’t issue OIDC tokens natively. Turnkey acts as an OIDC wrapper.-
OAuth2 Authenticate
POST /v1/oauth2_authenticate— Submit the OAuth 2.0authCode,redirectUri, PKCEcodeVerifier,nonce, andclientId. Turnkey exchanges the code, calls the provider’s user-info endpoint, and returns a Turnkey-issued OIDC token. -
OAuth Login
POST /v1/oauth_login— Use the Turnkey-issued token from step 1, same as a standard OIDC flow.
Signup (create sub-organization)
SignupPOST /v1/signup_v2 — Create a new sub-organization for an end user. Optionally creates a wallet and sets up credentials (API keys, passkeys, OAuth providers) in a single call.
Notable fields:
verificationToken— if provided, the sub-org is created with the user’s contact (email/phone) marked as verified (requires a prior OTP verify step).oauthProviders— accepts eitheroidcToken(verified) oroidcClaims({iss, sub, aud}, verified against an accompanying token). See Multi-platform OAuth identities.wallet— if provided, a wallet with the specified accounts is created atomically with the sub-org.clientSignature— optional client-side signature binding the signup request to a keypair.
Account lookup
Get AccountPOST /v1/account — Look up a sub-org by filterType (EMAIL, PHONE_NUMBER, CREDENTIAL_ID, OIDC_TOKEN, etc.) and filterValue. Returns the organizationId of the matching sub-org, or an empty response if none exists. Used to check whether a user already has an account before deciding to call signup vs. login.
Wallet Kit config
Get Wallet Kit ConfigPOST /v1/wallet_kit_config — Returns the auth method toggles and session configuration for the calling org. Used by react-wallet-kit to determine which auth methods to show in the modal.