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

Getting error as id_token_claims_invalid | nonce invalid #103

Open
Vigneshb14 opened this issue Feb 7, 2023 · 2 comments · May be fixed by #111
Open

Getting error as id_token_claims_invalid | nonce invalid #103

Vigneshb14 opened this issue Feb 7, 2023 · 2 comments · May be fixed by #111

Comments

@Vigneshb14
Copy link

Hi,

I tried to set up the apple login and signup using omni-auth apple gem in my application.

# config/initializers/omniauth.rb:

I want to get the id_token from the response because I need the user email every time while hitting this URL

  provider :apple, Rails.application.credentials[:apple_client_id] // ID from service's bundler (eg: com.domain.api), '',
             authorized_client_ids: [Rails.application.credentials[:apple_ui_client_id]] // ID from app's identifier (eg: com.domain.app),
             scope: 'email name',
             team_id: Rails.application.credentials[:apple_team_id],
             key_id: Rails.application.credentials[:apple_key_id],
             pem: Rails.application.credentials[:apple_private_key] // add the pem content with an extra newline at the end,
             provider_ignores_state: true

Error returns:

Authentication failure! invalid_credentials: OmniAuth::Strategies::OAuth2::CallbackError, id_token_claims_invalid | nonce invalid

Please help me to sort out this error.

@bvogel
Copy link

bvogel commented May 23, 2023

possible solution is to add this monkey-patch to your initializers

@bvogel
Copy link

bvogel commented Dec 21, 2023

the rejected PR #107 offered a solution. As that was rejected I'm waiting/expecting @nov to suggest a solution that will work with a decent session configuration (as in not using SameSite: :none) and nonce working at the same time. I wouldn't hold my breath on that.

@bvogel bvogel linked a pull request Dec 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants