I have two Auth0 tenants.
I could get the access token with social connection to another Auth0 tenant.
However, I can’t get the access token with jwt format (I could’t find the way to specify the audience from the social connection).
Could you tell me the way to get access token with jwt?
In order to get a JWT for the Access Token, you’d need to register an API in your Auth0 tenant and use its identifier as the audience in the /authorize request.
When you use a custom social connection associated with a separate Auth0 tenant, the Access Token you receive in the /token response is still intended for the application’s Auth0 tenant (not the custom social connection). This will be an opaque Access Token that can be used for getting profile data from the /userinfo endpoint.
You can obtain an Access Token for the connection (or identity provider), by following the docs here: Identity Provider Access Tokens
I’m not sure of what the format would be in this case, but I’d imagine it would still be an opaque string to be used with the /userinfo endpoint of the social connection’s tenant.
Would you be able to register an API in the application’s tenant to represent the API that is associated to the social connection tenant?
Thank you very much for you response.
I could get the access token with jwt format.
Based on your advice, I took below procedure.
Create Machine to Machine App on TenantA
Adde allowed callback URL and Authorization Code Grant Types in the application.
Create social connection with the application on TenantB.
I tried to use social connection with Regular Web Application which has permission to use the API before getting your advice. That was the reason why I couldn’t get the access token with jwt.