Apple SignIn invalid grant from iOS

Hi, I have implemented login/signup using apple login in my website and everything is working fine. I have created a service id, created the key, configured the redirect uri and generated the client secret. Now I'm trying to implement the login on my iOS application and validate the login through our backend using apple API. The login is working on iOS and we correctly receive the authorization code but I can't validate it using the apple API. I'm using the exact same code for the website just changing the client id (I'm using the bundle id) and the client secret which I have regenerated with the bundle id. I always get the following response:

{ "error": "invalid_grant", "error_description": "The code has expired or has been revoked." }

What am I missing?

Hi iskyd,

The authorization grant code has a five (5) minute expiry, and is restricted to single-use. Please ensure this code has not been previously consumed, and is validated within 5 minutes after issuance.

I don't have much information about your app, web service, or configuration, to assist you here. Please submit a Technical Support Incident (TSI) so we can investigate the issue, when doing so, please provide the App ID, Services ID, and Team ID.

However, please be aware that the issue is within your own code and handling of our server responses, not the result of an Apple bug. I strongly suggest debugging this issue yourself before submitting your TSI.

Apple SignIn invalid grant from iOS
 
 
Q