"Sign in with Apple" implemented about a month ago worked well, but suddenly the following error began to occur on the 27th.
No changes have been made so far.
I tested it like this,
1. i got authorization code using Service ID
- Service ID is set correctly :
Presumably the Services IDs/App IDs all need to be associated with the same primary App ID. The key is then associated to that group via the primary App ID too. - i tried authorization code with Service ID using chrome browser :
https://appleid.apple.com/auth/authorize?response_type=code&response_mode=form_post&client_id={corrected service id}&redirect_uri={registered redirect uri}&state=test_0001&scope=email - successfully got the code.
- and requested api immately(The code is single use only and valid for five minutes)
2. and then, i tried validate the authorization grant code to obtain tokens
curl -X "POST" "https://appleid.apple.com/auth/token?client_id={corrected service id}&client_secret={corrected client_secret}&code={corrected code}&grant_type=authorization_code"
3. response is fails with an
invalid_grant
error, 400 status,
invalid_grant- i tried get authorization code and validate the authorization grant code both using same service id
- is not invalid_client error, and client secret is not expired too.
My decoded token looks like the following :
"iss": "XFY******",
"iat": 1584347794,
"exp": 1599899794,
"aud": "https://appleid.apple.com",
"sub": "{service_id}"
same test was working well for nearly two months. However, it is currently failing.
I am having a hard time to solve this problem
Has anyone experienced the same problem at about the same time?
On Apr 29, 2020, kyuillee wrote:
> Has anyone experienced the same problem at about the same time?
Could you please confirm if `redirect_uri` is included in your query parameters to the `/auth/token` HTTP POST request?
Could you also please confirm if the `alg` and `kid` are included in your JWT header?
Both requirements are documented on "Generate and validate tokens".
If so, please submit a bug report via Feedback Assistant or submit a Technical Support Incident (TSI) so I can help you each directly with your web application