# Unable to exchange token with Auth0 after Apple Sign In

**URL:** <https://community.auth0.com/t/unable-to-exchange-token-with-auth0-after-apple-sign-in/44813>\
**Category:** Get Help\
**Tags:** sign-in-with-apple, apple-sign-in, auth0\
**Created:** [June 17, 2020, 6:53am UTC](https://community.auth0.com/t/unable-to-exchange-token-with-auth0-after-apple-sign-in/44813 "2020-06-17T06:53:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran.gouda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.gouda/32/13267_2.png) [@kiran.gouda](https://community.auth0.com/u/kiran.gouda)\
**Post date:** [June 17, 2020, 6:53am UTC](https://community.auth0.com/t/unable-to-exchange-token-with-auth0-after-apple-sign-in/44813/1 "2020-06-17T06:53:40Z")

</div>

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

> **[How to Add Sign in with Apple to iOS Apps - Getting Started Guide](https://auth0.com/blog/learn-how-to-implement-sign-in-with-apple-easily/?_ga=2.59887149.148508274.1591605121-1578493547.1587999363)**
>
> Learn how to support Sign in with Apple on iOS and web apps. This can be an easy task if you use the right tools. Check out this tutorial...

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:

- [Add Sign In with Apple to Native iOS Apps - Auth0 Docs](https://auth0.com/docs/connections/nativesocial/apple)
- [Add Login Using the Authorization Code Flow - Auth0 Docs](https://auth0.com/docs/flows/guides/auth-code/add-login-auth-code) (used the suggested c# code here)

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

---

<div class="post-metadata">

**Author:** ![kiran.gouda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kiran.gouda/32/13267_2.png) [@kiran.gouda](https://community.auth0.com/u/kiran.gouda)\
**Post date:** [June 19, 2020, 6:43am UTC](https://community.auth0.com/t/unable-to-exchange-token-with-auth0-after-apple-sign-in/44813/2 "2020-06-19T06:43:24Z")

</div>

Could anyone help me in this regards.

---

<div class="post-metadata">

**Author:** ![Knight704](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/knight704/32/22058_2.png) [@Knight704](https://community.auth0.com/u/Knight704)\
**Post date:** [June 26, 2020, 6:42am UTC](https://community.auth0.com/t/unable-to-exchange-token-with-auth0-after-apple-sign-in/44813/3 "2020-06-26T06:42:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pantelis](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pantelis/32/14223_2.png) [@pantelis](https://community.auth0.com/u/pantelis)\
**Post date:** [July 17, 2020, 9:36am UTC](https://community.auth0.com/t/unable-to-exchange-token-with-auth0-after-apple-sign-in/44813/4 "2020-07-17T09:36:41Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![chaos\_coordinator](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chaos_coordinator/32/25501_2.png) [@chaos\_coordinator](https://community.auth0.com/u/chaos_coordinator)\
**Post date:** [November 12, 2020, 2:29pm UTC](https://community.auth0.com/t/unable-to-exchange-token-with-auth0-after-apple-sign-in/44813/5 "2020-11-12T14:29:14Z")

</div>

I have the same problem. I think there is a problem with the `authorizationCode` from Apple.  
In this document [Add Sign In with Apple to Native iOS Apps](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: [Authentication API Explorer](https://auth0.com/docs/api/authentication#get-token) the `code` parameter is the value obtained from the call to the `/authorize` endpoint ([Authentication API Explorer](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.
