Skip to content

Commit

Permalink
Upgrade to the v4 token endpoint for more complete ID tokens
Browse files Browse the repository at this point in the history
ID tokens returned by the v3 endpoint never include name or picture claims, even when they're requested and available.

Fixes #22.
  • Loading branch information
georgeclaghorn committed Oct 22, 2018
1 parent 215aa4a commit 095bbcf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/google_sign_in/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def client
GoogleSignIn.client_id,
GoogleSignIn.client_secret,
authorize_url: 'https://accounts.google.com/o/oauth2/auth',
token_url: 'https://www.googleapis.com/oauth2/v3/token',
token_url: 'https://www.googleapis.com/oauth2/v4/token',
redirect_uri: callback_url
end
end
2 changes: 1 addition & 1 deletion test/controllers/callbacks_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GoogleSignIn::CallbacksControllerTest < ActionDispatch::IntegrationTest

private
def stub_token_request(code:, **params)
stub_request(:post, 'https://www.googleapis.com/oauth2/v3/token').
stub_request(:post, 'https://www.googleapis.com/oauth2/v4/token').
with(body: { grant_type: 'authorization_code', code: code,
client_id: FAKE_GOOGLE_CLIENT_ID, client_secret: FAKE_GOOGLE_CLIENT_SECRET,
redirect_uri: 'http://www.example.com/google_sign_in/callback' }).
Expand Down

0 comments on commit 095bbcf

Please sign in to comment.