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

Add error code for duplicate claim value error code #6477

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

Conversation

KaveeshaPiumini
Copy link
Contributor

Purpose

When one or more attributes are configured as unique, and we attempt to register via the Self-Register API (https://localhost:9443/api/identity/user/v1.0/me) with a claim value already in use by another user (e.g., Mobile Number), the system responds with the following error:

{
"code": "20035",
"message": "Bad Request",
"description": "The value defined for Mobile is already in use by different user!",
"traceId": "92c0ae8e-da20-46a8-a181-81e27033c472"
}

The error code 20035 is currently defined for password policy violations.

Implementation

This PR fix the issue by introducing a new error code, ERROR_CODE_DUPLICATE_CLAIM_VALUE = "60007", in SelfRegistrationStatusCodes. In the duplicate claim value PolicyViolationException this error code is thrown with the error.

Related Issue

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.95%. Comparing base (4c5f013) to head (975037f).
Report is 4 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6477      +/-   ##
============================================
+ Coverage     46.78%   46.95%   +0.17%     
- Complexity    15348    15435      +87     
============================================
  Files          1747     1747              
  Lines        107449   106781     -668     
  Branches      19887    19815      -72     
============================================
- Hits          50272    50144     -128     
+ Misses        50003    49490     -513     
+ Partials       7174     7147      -27     
Flag Coverage Δ
unit 30.54% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

piraveena
piraveena previously approved these changes Feb 14, 2025
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