Greetings, We have been trying to implement the 'Sign-in with Apple' thing for quite some time now, but we are blocked by this 'invalid_client' error.
The backend itself is made with Python Flask and the error itself is returned when posting to the https://appleid.apple.com/auth/token endpoint.
I doubled checked all JWTs via the website jwt.io and everything checks out. We have tried regenerating the keys multiple times without any success.
For the client secret, we are indeed using the ES256 algorithm as specified in the documentation.
The code itself looks like this:
token_url = 'https://appleid.apple.com/auth/token'
headers = {'content-type': "application/x-www-form-urlencoded"}
data = {
'client_id': client_id,
'client_secret': client_secret,
'code': authorization_code,
'grant_type': 'authorization_code',
'redirect_uri': redir_uri,
}
token_response = requests.post(token_url, data=data, headers=headers)
Anyone has any idea?
Thanks!