Skip to content

fix(connector): support string typed boolean ID token claims for OIDC connector #7276

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

Merged

Conversation

darcyYe
Copy link
Contributor

@darcyYe darcyYe commented Apr 11, 2025

Summary

Add an optional acceptStringTypedBooleanClaims configuration to OidcConnectorConfig, with default value false.
For standard OIDC protocol, some claims such as email_verified and phone_verified are boolean-typed, but some providers may return them as string-typed. Enabling this option will convert string-typed boolean claims to boolean-typed, which provides better compatibility.
By enabling this configuration, the connector will accept string-typed boolean ID token claims, such as email_verified and phone_verified.

Testing

Covered by unit tests.

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@darcyYe darcyYe requested a review from gao-sun as a code owner April 11, 2025 04:19
Copy link

github-actions bot commented Apr 11, 2025

COMPARE TO master

Total Size Diff 📈 +4.77 KB

Diff by File
Name Diff
.changeset/selfish-zoos-worry.md 📈 +611 Bytes
packages/connectors/connector-oidc/src/constant.ts 📈 +521 Bytes
packages/connectors/connector-oidc/src/index.ts 📈 +165 Bytes
packages/connectors/connector-oidc/src/types.test.ts 📈 +2.88 KB
packages/connectors/connector-oidc/src/types.ts 📈 +640 Bytes

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

packages/connectors/connector-oidc/src/types.ts:34

  • [nitpick] Consider shortening the name 'idTokenProfileStandardClaimsGuardAcceptingStringTypedBooleanClaims' for improved readability. For instance, a simpler name like 'idTokenClaimsGuardWithStringBooleans' might enhance clarity.
// Extend `idTokenProfileStandardClaimsGuard` by accepting string-typed boolean claims.

Copy link
Contributor

@simeng-li simeng-li left a comment

Choose a reason for hiding this comment

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

overall LGTM

Copy link
Member

@gao-sun gao-sun left a comment

Choose a reason for hiding this comment

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

lgtm on changeset

@darcyYe darcyYe enabled auto-merge (squash) April 15, 2025 02:20
@darcyYe darcyYe merged commit 752d406 into master Apr 15, 2025
34 checks passed
@darcyYe darcyYe deleted the yemq-oidc-connector-support-string-typed-boolean-claims branch April 15, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants