Authenticates the Discovery OAuth token and exchanges it for an Intermediate Session Token. Intermediate Session Tokens can be used for various Discovery login flows and are valid for 10 minutes.
Authenticate Discovery OAuth
POSThttps://test.stytch.com/v1/b2b/oauth/discovery/authenticate
Body parameters
discovery_oauth_token* string
pkce_code_verifier string
Response fields
request_id string
status_code int
intermediate_session_token string
email_address string
discovered_organizations array
provider_type string
provider_tenant_id string
provider_tenant_ids array[string]
curl --request POST \
--url https://test.stytch.com/v1/b2b/oauth/discovery/authenticate \
-u 'PROJECT_ID:SECRET' \
-H 'Content-Type: application/json' \
-d '{
"discovery_oauth_token": "hdPVZHHX0UoRa7hJTuuPHi1vlddffSnoweRbVFf5-H8g"
}'
RESPONSE
200
{
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"status_code": 200,
"intermediate_session_token": "SeiGwdj5lKkrEVgcEY3QNJXt6srxS3IK2Nwkar6mXD4=",
"email_address": "sandbox@stytch.com",
"discovered_organizations": [{...}, {...}],
"provider_type": "Github",
"provider_tenant_id": "1234567",
"provider_tenant_ids": ["1234567"]
}