Apple provider invalid_client
When I try to use:
Socialite::driver('apple')->stateless()->user()
inside the callback function, I encounter an error: invalid_client.
The root cause is in the method:
$response = $this->getAccessTokenResponse($this->getCode());
This method makes a Guzzle POST request to the /auth/token endpoint without including the required header 'Content-Type: application/x-www-form-urlencoded'. However, this header is required for the endpoint to process the request correctly.
Same issue
Client error: `POST https://appleid.apple.com/auth/token` resulted in a `400 Bad Request` response:
{"error":"invalid_client"}
Also, it should be a GET request but doesn't work with GET request as it shows Method Not allowed
@xcode-it , my initial assumption was incorrect. In my case, the issue was related to the use of the firebase/php-jwt package, which was generating an invalid JWT token. After switching to the lcobucci/jwt package, the problem was resolved.
@xcode-it Tks for the tip, with your comment I was able to search and find a solution.
I had the same problem, in the past, i was created a token using the rb script, now I changed to a dinamyc and automatic way to generate the apple tokens , I used this article
I have created a PR for this: https://github.com/SocialiteProviders/Providers/pull/1019
Is this issue fixed? I am still getting this issue even after using new valid apple_id and client_secret. Please advise
Is this issue fixed? I am still getting this issue even after using new valid
apple_idandclient_secret. Please advise
not solved. use another package for creating the token.
PR above is merged.