Hello Ory Team, I’m facing an issue with social s...
# ory-selfhosting
g
Hello Ory Team, I’m facing an issue with social sign-in using Google in my React Native application with Ory Kratos. Issue Description: 1. I have enabled social sign-in (Google) in my app. 2. During the registration process, a phone number is required in addition to the email. 3. When I click on “Sign Up with Google,” a browser opens where I select a Google account. 4. After selecting the account, I am redirected to a form where my email, first name, and last name are pre-filled, and I need to enter my phone number. 5. I fill in the phone number and click “Continue.” 6. Instead of proceeding with the registration, the browser reopens with the Google account selection screen again. 7. After selecting the account again, I am redirected back to the form where I have to enter the phone number again. 8. This process repeats in a loop, making registration impossible. I have reproduced this issue using the example application code from the Ory documentation. (screen attached) Thank you in advance for your support!
Simulator Screenshot - iPhone 15 Pro - 2025-03-19 at 00.22.06.png
d
@green-hydrogen-40793 I just had the same issue!! and spend ~3 days trying to work this out. I had an error in your
google-jsonnet.json
, once I recude it to
Copy code
local claims = {
  email_verified: false
} + std.extVar('claims');

{
  identity: {
    traits: {
      // Allowing unverified email addresses enables account
      // enumeration attacks, especially if the value is used for
      // e.g. verification or as a password login identifier.
      //
      // Therefore we only return the email if it (a) exists and (b) is marked verified
      // by GitHub.
      [if "email" in claims && claims.email_verified then "email" else null]: claims.email,
    },
  },
}
it did a thing. Keep in mind I even strip name to make it work ...
which is more surpricing even example for google from official docs https://www.ory.sh/docs/kratos/social-signin/google aren't working. If I add anything but email it goes to redirects. looks like a bug to me
but it works like this
Copy code
local claims = {
  email_verified: false
} + std.extVar('claims');

{
  identity: {
    traits: {
      // Allowing unverified email addresses enables account
      // enumeration attacks, especially if the value is used for
      // e.g. verification or as a password login identifier.
      //
      // Therefore we only return the email if it (a) exists and (b) is marked verified
      // by GitHub.
      [if "email" in claims && claims.email_verified then "email" else null]: claims.email,
    },
    metadata_public: {
      name: claims.name,
    }
  },
}