Skip to main content
X-Auth-Proxy-Config-Id
string
required
Your Auth Proxy config ID, found in Dashboard → AUTH. See Auth Proxy reference for setup.
provider
enum<string>
required
Enum options: OAUTH2_PROVIDER_X, OAUTH2_PROVIDER_DISCORD
authCode
string
required
The auth_code provided by the OAuth 2.0 to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow
redirectUri
string
required
The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider
codeVerifier
string
required
The code verifier used by OAuth 2.0 PKCE providers
nonce
string
An optional nonce used by the client to prevent replay/substitution of an ID token
clientId
string
required
The client ID registered with the OAuth 2.0 provider
A successful response returns the following fields:
oidcToken
string
required
A Turnkey issued OIDC token to be used with the LoginWithOAuth activity
curl --request POST \
  --url https://authproxy.turnkey.com/v1/oauth2_authenticate \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-Auth-Proxy-Config-Id: <string> (see Authorizations)" \
  --data '{
    "provider": "<OAUTH2_PROVIDER_X>",
    "authCode": "<string>",
    "redirectUri": "<string>",
    "codeVerifier": "<string>",
    "nonce": "<string>",
    "clientId": "<string>"
}'
{
  "oidcToken": "<string>"
}