I managed to implement apple sign-in and it works fine locally, but when I deploy to a webserver and it make request to token rest api (https://appleid.apple.com/auth/token) I receive {"error":"invalid_client"} 400 error. I run out of ideas what to do with this helpful message.
Overall I can say that apple API is not user friendly. At least I would expect error description with more specific information.