Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple - 400 Bad Request on calling userFromToken Method #1004

Closed
sandeepthakkar23 opened this issue Apr 11, 2023 · 5 comments
Closed

Apple - 400 Bad Request on calling userFromToken Method #1004

sandeepthakkar23 opened this issue Apr 11, 2023 · 5 comments

Comments

@sandeepthakkar23
Copy link

sandeepthakkar23 commented Apr 11, 2023

Hello,

I am using "laravel/socialite": "^5.6", socialite for apple provider.

And I have implemented socialite as per this reference (https://devpeel.com/implement-apple-sign-in-with-laravel/) to Laravel 10.

After getting apple login response, passing required parameter to reference code. There is one method userFromToken which not working and giving below errors:

GuzzleHttp\Exception\ClientException: Client error: POST https://appleid.apple.com/auth/token resulted in a 400 Bad Request response:
{"error":"invalid_request"}

invalid_request

*The same things is working to postman request.

Please help for the same.

Thanks in advance!!

@hamrak
Copy link
Contributor

hamrak commented Apr 19, 2023

https://developer.apple.com/documentation/technotes/tn3107-resolving-sign-in-with-apple-response-errors

Maybe it will help you solve or at least find your problem.

@sandeepthakkar23
Copy link
Author

sandeepthakkar23 commented Apr 19, 2023

https://developer.apple.com/documentation/technotes/tn3107-resolving-sign-in-with-apple-response-errors

Maybe it will help you solve or at least find your problem.

Thanks for answer. But I have checked same things using postman where it working fine.

@hamrak
Copy link
Contributor

hamrak commented May 3, 2023

It's strange that you can't do it through the app (get error), but you can through Postman.

It works for me, but I always generate a new JWT immediately upon request to be sure that it is valid.
That's why I sent a PR #1019 with extended configuration, so that I could use the certificate instead of the secret key.
Secret key is always generated.

Which HTTP Client do you have? Maybe is something wrong in the POST request if your secret key (token) is correct.

Here is good discussion: https://developer.apple.com/forums/thread/124521

@ian-nisbet
Copy link

I had the 400 invalid_request error, because I did not have the callback route defined for POST HTTP method. Other Socialite providers redirect to the defined URI, but Apple ID posts to APPLE_REDIRECT_URI

@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 17, 2023
@atymic atymic removed the stale label Feb 7, 2024
@atymic atymic closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants