Token exchange for native Apple login in a React app

Hi,

I don’t want to use the Universal Login experience as it throws a clunky Safari popup for users. Therefore I’m doing Native login with Apple (which is successful) then I’m calling this endpoint: https://auth0.com/docs/api/authentication#token-exchange-for-native-social

with this body:

const tokenExchangeBody: Record<string, string> = {
grant_type: ‘urn:ietf:params:oauth:grant-type:token-exchange’,
subject_token: credential.identityToken,
subject_token_type: ‘urn:ietf:params:oauth:token-type:id_token’,
client_id: auth0ClientId,
audience: process.env.EXPO_PUBLIC_AUTH0_API_IDENTIFIER ‘’,
scope: ‘openid profile email offline_access’,
};

However, I keep getting:
Invalid subject_token_type.

Is this token exchange feature gated to paying customers only? Why is it not working?

Hi @tom28,

Welcome to the Auth0 Community!

It is mentioned in our Custom Token Exchange documentation that:

Custom Token Exchange is currently in Early Access for Enterprise customers only

Since this feature is currently only in an Early Access stage, it is available only for a specific number of tenants and access to it can only be granted by directly contacting our support teams.

I hope this helps!
Thanks,
Remus