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

Callback URL giving Client error: POST https://appleid.apple.com/auth/token resulted in a 400 Bad Request response: {"error":"invalid_client"} #23

Closed
wamtengineers opened this issue Jun 17, 2020 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@wamtengineers
Copy link

Everything works fine except when landing on callback url the post request giving an error.

Client error: POST https://appleid.apple.com/auth/token resulted in a 400 Bad Request response: {"error":"invalid_client"}

@mikebronner mikebronner self-assigned this Jun 17, 2020
@mikebronner
Copy link
Owner

This sounds like a configuration issue where your client ID in the app might not be matching the client ID you have registers with your Apple developer account?

@mikebronner mikebronner added the question Further information is requested label Jun 17, 2020
@wamtengineers
Copy link
Author

If Client ID I have put is Service identifier as per your instruction in the documentation. It is going through normal process when clicking apple icon here https://ignitefiringsystems.com/fireworks/login but after successful authentication it is showing error screen.
image

@mikebronner
Copy link
Owner

Thanks for clarifying. I will see if I can replicate this.

@mikebronner mikebronner added bug Something isn't working and removed question Further information is requested labels Jun 17, 2020
@WilliamBlais
Copy link

@wamtengineers Make sure that the Client ID in .env and client_secret.rb is the same, otherwise you'll get this error (only on the callback).

@wamtengineers
Copy link
Author

Sorry! Could you please elaborate? I did not understand.

@wamtengineers
Copy link
Author

Ok I regenerated Client Secret and yes there was a mistake is Client ID parameter. now the error is gone. But I am receiving a null user object. This is debug output.

object(Laravel\Socialite\Two\User)#325 (9) { ["token"]=> string(63) "" ["refreshToken"]=> string(63) "" ["expiresIn"]=> int(3600) ["id"]=> string(44) "000338.4012a42560234b479fb39f7f1c17a3b0.1821" ["nickname"]=> NULL ["name"]=> NULL ["email"]=> NULL ["avatar"]=> NULL ["user"]=> array(8) { ["iss"]=> string(25) "https://appleid.apple.com" ["aud"]=> string(38) "com.ignitefiringsystems.ignitesservice" ["exp"]=> int(1593109908) ["iat"]=> int(1593109308) ["sub"]=> string(44) "000338.4012a42560234b479fb39f7f1c17a3b0.1821" ["at_hash"]=> string(22) "dfVweljsZJMzvYmo5vETig" ["auth_time"]=> int(1593109307) ["nonce_supported"]=> bool(true) } }

@mikebronner
Copy link
Owner

If this is happening, during development and testing, you will need to remove your signing-registration at https://appleid.apple.com, then re-register. Each time you fail/test the initial registration process, you will need to remove your app signing registration at apple.com in order to start from a blank slate. This error will always come up if your initial registration had any issues.

@RoseRiyadh
Copy link

same problem happens to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@mikebronner @WilliamBlais @wamtengineers @RoseRiyadh and others