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

feat: add ID Token sign in with Google SDK #3515

Merged
merged 5 commits into from
Sep 19, 2023

Conversation

jonas-jonas
Copy link
Member

@jonas-jonas jonas-jonas commented Sep 15, 2023

This PR adds support for social sign in via Google using an ID token instead of the browser based OIDC flows. This allows integration of the SDK for Google sign in on Android & iOS.

Related issue(s)

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

@jonas-jonas jonas-jonas self-assigned this Sep 15, 2023
@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Merging #3515 (98958e0) into master (dd5a9f3) will decrease coverage by 0.01%.
Report is 5 commits behind head on master.
The diff coverage is 68.18%.

❗ Current head 98958e0 differs from pull request most recent head e418cbe. Consider uploading reports for the commit e418cbe to get more accurate results

@@            Coverage Diff             @@
##           master    #3515      +/-   ##
==========================================
- Coverage   78.41%   78.40%   -0.01%     
==========================================
  Files         340      340              
  Lines       22533    22533              
==========================================
- Hits        17669    17667       -2     
- Misses       3556     3557       +1     
- Partials     1308     1309       +1     
Files Changed Coverage Δ
driver/config/config.go 83.66% <0.00%> (ø)
driver/registry.go 40.62% <ø> (ø)
driver/registry_default.go 87.19% <ø> (ø)
session/session.go 78.90% <ø> (ø)
selfservice/strategy/password/registration.go 67.74% <50.00%> (ø)
session/handler.go 68.60% <66.66%> (ø)
selfservice/strategy/password/settings.go 73.13% <71.42%> (ø)
selfservice/strategy/oidc/provider_google.go 86.66% <73.33%> (ø)
persistence/sql/persister.go 69.89% <77.77%> (ø)
selfservice/strategy/oidc/provider_apple.go 37.93% <80.00%> (ø)
... and 1 more

... and 1 file with indirect coverage changes

var _ NonceValidationSkipper = new(ProviderGoogle)

func (a *ProviderGoogle) CanSkipNonce(c *Claims) bool {
return true // TODO!!
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause Ory to only validate nonces for Google if the ID Token from Google contains a nonce.

Since the SDKs I saw, don't support setting nonces, this is the best solution I can come up, without excluding a bunch of SDKs here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this is fine for me. Please document this as a caveat though when writing docs for this!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adjusted it to only return true, if no nonce is present in the claims.

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue with the HTTP client (it is not using the SSRF protected HTTP client). Otherwise LGTM

selfservice/strategy/oidc/provider_google.go Outdated Show resolved Hide resolved
@jonas-jonas jonas-jonas marked this pull request as ready for review September 18, 2023 09:07
@aeneasr aeneasr self-requested a review September 18, 2023 09:38
@jonas-jonas
Copy link
Member Author

Docs PR: ory/docs#1540

@aeneasr aeneasr merged commit 055ed92 into master Sep 19, 2023
26 checks passed
@aeneasr aeneasr deleted the jonas-jonas/supportGoogleIDToken branch September 19, 2023 05:53
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

Successfully merging this pull request may close these issues.

2 participants