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

Support storing multiple mobile numbers and email addresses per user #817

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

lashinijay
Copy link
Contributor

@lashinijay lashinijay commented Apr 19, 2024

Proposed changes in this pull request

$subject.

This feature will be enabled by default for the latest product, however with the following config in deployment.toml, the multiple support for email addresses and mobile numbers can be disabled.

[identity_mgt.user_claim_update.support_multi_emails_and_mobile_numbers_per_user]
enable = false

verifiedEmailAddresses and verifiedMobileNumbers claims can only be updated when Enable user email verification on update and the above config are both enabled.

Multiple email addresses support

Users will be able to store multiple email addresses in newly introduced custom claim http://wso2.org/claims/emailAddresses and multiple verified email addresses in http://wso2.org/claims/verifiedEmailAddresses claim.

case 01
when support multiple email and mobile numbers per user and Enable user email verification on update is both enabled, the primary email address of the user (http://wso2.org/claims/emailaddress) can only be updated to one of the existing email addresses in verifiedEmailAddresses claim.
case 02
when support multiple email and mobile numbers per useris disabled andEnable user email verification on update` is enabled, users can directly update the primary email address (http://wso2.org/claims/emailaddress) which will initiate the email verification process for the update email address.

Multiple mobile numbers support

Users will be able to store multiple mobile numbers in newly introduced custom claim http://wso2.org/claims/mobileNumbers and multiple verified mobile numbers in http://wso2.org/claims/verifiedMobileNumbers claim.

case 01
when support multiple email and mobile numbers per user and Enable user mobile verification on update is both enabled, the primary mobile number of the user (http://wso2.org/claims/mobile) can only be updated to one of the existing mobile numbers in verifiedMobileNumbers claim.
case 02
when support multiple email and mobile numbers per useris disabled andEnable user mobile verification on update` is enabled, users can directly update the primary mobile number (http://wso2.org/claims/mobile) which will initiate the mobile verification process for the update mobile number.

Related Git Issue

@lashinijay lashinijay changed the title Support storing multiple mobile numbers and multiple verified mobile numbers per user Support storing multiple mobile numbers and email addresses per user May 30, 2024
if (claims.containsKey(IdentityRecoveryConstants.MOBILE_NUMBER_CLAIM) &&
!verifiedMobileNumbers.contains(claims.get(IdentityRecoveryConstants.MOBILE_NUMBER_CLAIM))) {
throw new IdentityEventClientException(IdentityRecoveryConstants.ErrorMessages.
ERROR_CODE_MOBILE_NUMBER_SHOULD_BE_INCLUDED_IN_VERIFIED_MOBILES_LIST.getCode(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we rename this to something like ERROR_CODE_PRIMARY_MOBILE_NUMBER_SHOULD_BE_INCLUDED_IN_VERIFIED_MOBILES_LIST. By just looking at the variable name, got confused why we need to have this check here.

@lashinijay
Copy link
Contributor Author

Update the license header

…/wso2/carbon/identity/recovery/connector/UserClaimUpdateConfigImplTest.java
@lashinijay lashinijay force-pushed the mulitple-mobile-number-support branch from 618d0ee to bdee942 Compare July 8, 2024 10:45
# Conflicts:
#	components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/util/Utils.java
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.

3 participants