Conversation
Contributor
|
LGTM, just needs some tests |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds support for verified email attributes in the Internet Identity OpenID integration. The feature allows certification of email addresses that have been verified by identity providers (Google and Microsoft), ensuring that the authenticated user actually controls the email address.
Changes:
- Added
VerifiedEmailvariant to theAttributeNameenum for certifying verified email addresses - Introduced
OpenIdEmailVerificationSchemeenum with Google and Microsoft variants, along with corresponding Candid types - Implemented provider-specific email verification logic: Google uses
email_verifiedclaim, Microsoft validates personal account tenant IDs - Refactored attribute preparation to use dedicated getter methods with improved maintainability
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/internet_identity_interface/src/internet_identity/types/attributes.rs | Adds VerifiedEmail to AttributeName enum with string conversions |
| src/internet_identity_interface/src/internet_identity/types.rs | Defines OpenIdEmailVerificationScheme enum and adds email_verification field to OpenIdConfig |
| src/internet_identity/src/openid/generic.rs | Implements email_verified claim parsing (supporting both bool and string types), validation, and metadata storage |
| src/internet_identity/src/openid.rs | Adds email verification methods for Google and Microsoft, extends OpenIdProvider trait with email_verification_schema method |
| src/internet_identity/src/attributes.rs | Refactors attribute preparation to use getter methods and adds comprehensive unit tests for verified email scenarios |
| src/internet_identity/internet_identity.did | Adds OpenIdEmailVerification variant type to Candid interface |
| src/internet_identity/tests/integration/*.rs | Updates all OpenIdConfig instantiations to include email_verification field (set to None) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aterga
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support new identity attributes
verified_emailthat are certified by II only upon evidence that the email address is actually controlled by the authenticated user.Changes
VerifiedEmailvariant to theAttributeNameenum for certifying verified email addressesOpenIdEmailVerificationSchemeenum with Google and Microsoft variants, along with corresponding Candid typesemail_verifiedclaim, Microsoft validates personal account tenant IDsTests
Verified email attribute tests (
verified_email_tests)Sets up real Google and Microsoft providers via
openid::setupsoconfig_issuer(),get_verified_email(), and scope matching all work end-to-end throughprepare_openid_attributes.Google (
email_verifiedclaim, case-insensitive):email_verifiedis"true"email_verifiedis"false"email_verifiedmetadata is absentemailmetadata is absent (even ifemail_verifiedis"true")"True") — verifies case-insensitive checkemail_verifiedis stored asBytesinstead ofStringMicrosoft (
tid-based personal account check):tidmatches the personal account tenant IDtidis missing (provider can't resolve{tid}placeholder)emailmetadata is absentCombined / cross-cutting:
emailandnameattributes in one requestAll tests also assert that
requestedis properly drained (empty after call) when the scope was consumed, or remains non-empty when the credential was skipped.