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

Accept NULL values for Picture and Name values for OCID responses #4702

Closed
wants to merge 2 commits into from

Conversation

piscis
Copy link

@piscis piscis commented Nov 26, 2024

What does this PR do?

This PR enabled OCID payloads to contain name and picture keys with NULL values. This is especially important in case you connect a third party IDP solution like logto.io or keycloak which estables logins via SignIn with apple.

By allowing name and picture to be defined as null its possible to use login provider that do not provide the name or picture for a user but encode them as null values in the OCID token exchange.

Corresponding ISSUE: #4701

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

None

Does this PR introduce any new environment variables or feature flags?

None

If any indexes were added, were they added to INDEXES.md?

None

How do I test this PR?

Method 1:

  1. Setup a development server with this pr
  2. Register a Free logto.io instance
  3. Configure a third party OCID application inside logto.io - https://docs.logto.io/integrations/third-party-oidc/
  4. Configure the OCID connector inside your Coral Talk
  5. Configure SignIn with Apple inside of the logto instance
  6. LogIn with apple
  7. During registration a user should be able to sign up and pick a username

Methode 2:

  1. Mock the token exchange between your IDP and CoralTalk by setting the picture and name element to null

Were any tests migrated to React Testing Library?

No

How do we deploy this PR?

No actions needed

Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit 4f51bb0
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/6745f5b505bf520009b96e0d

@tessalt
Copy link
Contributor

tessalt commented Nov 29, 2024

Hi there! thanks so much for your submission and bug report. I'm going to close this in favour of #4704 but thanks again!

@tessalt tessalt closed this Nov 29, 2024
@piscis
Copy link
Author

piscis commented Nov 29, 2024

Hi @tessalt thanks for the reply I had a look at the other PR, I'm not an expert on JOI but I thought you have to flag it as allow(null) values and not optional because you already flagging picture and name as optional with the fork statement here down below.

.fork(
[
"picture",
"email",
"email_verified",
"name",
"nickname",
"preferred_username",
],
(s) => s.optional()
);

I'm going to test PR #4704 with Apple SignIn as soon as its released and report back if there are problems. Thanks again for looking into it

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