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

invalid_client error #20

Open
harrisreynolds opened this issue Dec 22, 2023 · 2 comments
Open

invalid_client error #20

harrisreynolds opened this issue Dec 22, 2023 · 2 comments

Comments

@harrisreynolds
Copy link

I'm getting a weird invalid_client error trying to implement Sign in with Apple using this gem.

It is always failing on this line:

token_response = @client.access_token!

12:07:12 web.1  | #<AppleID::Client:0x00000001100a4518 @identifier="app.prayerteam.web", @team_id="FL726TVN3W.app.prayerteam", @key_id="YG33TJYKQ7", @private_key=#<OpenSSL::PKey::EC:0x00000001100a46f8 oid=id-ecPublicKey>, @secret=nil, @certificate=nil, @redirect_uri="https://exactly-holy-sunbird.ngrok-free.app/users/auth/apple/callback", @scheme=nil, @host=nil, @port=nil, @authorization_endpoint="https://appleid.apple.com/auth/authorize", @token_endpoint="https://appleid.apple.com/auth/token", @revocation_endpoint="https://appleid.apple.com/auth/revoke", @userinfo_endpoint="/userinfo", @expires_in=nil, @grant=#<Rack::OAuth2::Client::Grant::AuthorizationCode:0x000000011009eac8 @code="c46359e7ee0fc4df6a370c6a794cc7a9a.0.mryut.Qt7BFiM6rbza0iK5SEG4TA", @redirect_uri="https://exactly-holy-sunbird.ngrok-free.app/users/auth/apple/callback">>
12:07:13 web.1  | Completed 500 Internal Server Error in 465ms (ActiveRecord: 6.0ms | Allocations: 14572)
12:07:13 web.1  |
12:07:13 web.1  |
12:07:13 web.1  |
12:07:13 web.1  | AppleID::Client::Error (invalid_client):
12:07:13 web.1  |
12:07:13 web.1  | app/controllers/apple_signin_controller.rb:41:in `apple_callback'

I've included in the snippet above my @client variable.

Any ideas here? This is my second run (first run was with the Apple Omniauth gem) at implementing this and have been stuck for hours trying to get basic Apple Signin to work.

@harrisreynolds
Copy link
Author

Every thing works fine routing to Apple and authenticating, but the callback fails.

@nov
Copy link
Owner

nov commented Jan 3, 2024

debug raw http messages by using AppleID.debug! & curl etc.
maybe client credential is wrong

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

2 participants