Unable to exchange token with Auth0 after Apple Sign In

I followed below approach but in Xamarin to achieve apple sign in.

But i am not able to get the exchange token from Auth0 after getting the Authorization token from Apple.
Followed below links for the same:

i am getting this below error in response:
{“error”:“invalid_grant”,“error_description”:“Invalid authorization code”}

Could anyone help me to resolve this issue.

Thank you

1 Like

Could anyone help me in this regards.

You’ve probably passing data to /oauth/token endpoint wrong, take attention to content-type it should be x-www-formurlencoded, not a json.

I personally have passed this, but struggling with error from apple

@Knight704 when i am passing x-www-formurlencoded i receive a 401 error, when i don’t pass it i receive a 403 error. any ideas? Nobody answers me from auth0

2 Likes

I have the same problem. I think there is a problem with the authorizationCode from Apple.
In this document https://auth0.com/docs/connections/nativesocial/apple?_ga=2.31907390.1074238168.1604876548-2110409495.1594806951 the step 3 does not work.
When I see the /oauth/token endpoint documentation: https://auth0.com/docs/api/authentication#get-token the code parameter is the value obtained from the call to the /authorize endpoint (https://auth0.com/docs/api/authentication#authorization-code-flow). But the authorize endpoint trigger the web based authorization (Universal Authorization).
So the problem is how to get the proper code from /authorize endpoint without triggering the web authorization or how to configure the Apple Sign In in the Auth0 settings to accept the Apple authorizationCode.