Skip to content

Conversation

@fidelianawar
Copy link
Contributor

PR Title Format

Required Format: [Keyword1] [Keyword2]: Description

  • Keyword1: major, minor, or patch (case-insensitive)
  • Keyword2: feature, bugfix, engg, or tests (case-insensitive)

Examples:

  • [MAJOR] [Feature]: new API
  • [minor] [bugfix]: fix crash
  • [PATCH] [tests]: add coverage

Proposed changes

Describe what this PR is trying to do.

Type of change

  • Feature work
  • Bug fix
  • Documentation
  • Engineering change
  • Test
  • Logging/Telemetry

Risk

  • High – Errors could cause MAJOR regression of many scenarios. (Example: new large features or high level infrastructure changes)
  • Medium – Errors could cause regression of 1 or more scenarios. (Example: somewhat complex bug fixes, small new features)
  • Small – No issues are expected. (Example: Very small bug fixes, string changes, or configuration settings changes)

Additional information

@@ -139,7 +139,8 @@ + (void)initialize
@(MSIDErrorServerInvalidState) : @(MSALInternalErrorInvalidState),

Choose a reason for hiding this comment

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

This pull request does not update CHANGELOG.md.

Please consider if this change would be noticeable to a partner or user and either update CHANGELOG.md or resolve this conversation.

Copy link
Contributor

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.

Pull request overview

Adds an MSAL-facing error code intended to mirror/represent MSIDErrorServerInvalidRequestResetPasswordRequired, and wires it through the MSID→MSAL error conversion layer so apps can detect this condition.

Changes:

  • Introduces MSALErrorServerInvalidRequestResetPasswordRequired with value -50142 in the public error header.
  • Adds an error-code mapping in MSALErrorConverter from MSIDErrorServerInvalidRequestResetPasswordRequired to the new MSAL error code.

Reviewed changes

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

File Description
MSAL/src/public/MSALError.h Adds a new error constant intended for consumption by MSAL callers.
MSAL/src/MSALErrorConverter.m Maps the MSID error code to the new MSAL error code during conversion/classification.

Error is thrown when PSSO user registration attempted with no biometrics configured and sekey biometric policy is configured
*/
MSALErrorPSSOBiometricsNotEnrolled = -42744,

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

There’s an extra blank line (and potentially trailing whitespace) added just before the new enum value. Please remove any trailing whitespace and keep spacing consistent with the surrounding enum declarations.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines 141 to 144
@(MSIDErrorServerUnhandledResponse) : @(MSALInternalErrorUnhandledResponse),
@(MSIDErrorUnexpectedHttpResponse) : @(MSALInternalErrorUnexpectedHttpResponse)
@(MSIDErrorUnexpectedHttpResponse) : @(MSALInternalErrorUnexpectedHttpResponse),
@(MSIDErrorServerInvalidRequestResetPasswordRequired) : @(MSALErrorServerInvalidRequestResetPasswordRequired)
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

As written, this new mapping will typically not be observable by callers: msalErrorFromMsidError: uses classifyErrors:YES, and errorWithDomain:... reclassifies any mapped code not in s_recoverableErrorCode to MSALErrorInternal (storing the original mapped code under MSALInternalErrorCodeKey). If the intent is to expose this as a new handleable MSALError code, add it to s_recoverableErrorCode so it isn’t collapsed to MSALErrorInternal.

Copilot uses AI. Check for mistakes.
Comment on lines +142 to +143
@(MSIDErrorUnexpectedHttpResponse) : @(MSALInternalErrorUnexpectedHttpResponse),
@(MSIDErrorServerInvalidRequestResetPasswordRequired) : @(MSALErrorServerInvalidRequestResetPasswordRequired)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

MSIDErrorServerInvalidRequestResetPasswordRequired is referenced here, but it doesn’t appear to be defined anywhere in this repo snapshot (searching under the repo only finds this usage). If this constant was added in IdentityCore, this PR likely also needs to update the IdentityCore submodule pointer (or otherwise include the header/version that defines it) to avoid a compile failure.

Copilot uses AI. Check for mistakes.
Comment on lines +142 to 144
@(MSIDErrorUnexpectedHttpResponse) : @(MSALInternalErrorUnexpectedHttpResponse),
@(MSIDErrorServerInvalidRequestResetPasswordRequired) : @(MSALErrorServerInvalidRequestResetPasswordRequired)
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Please add a unit test to cover this new error mapping, asserting that an MSIDErrorDomain error with code MSIDErrorServerInvalidRequestResetPasswordRequired converts to MSALErrorServerInvalidRequestResetPasswordRequired (and stays that code when classifyErrors:YES, if that’s the intended behavior). The existing MSALErrorConverterTests suite has coverage for other mapped server errors but nothing that would fail if this specific mapping gets reclassified to MSALErrorInternal.

Copilot uses AI. Check for mistakes.
Comment on lines 576 to 579
MSALErrorPSSOBiometricsNotEnrolled = -42744,

MSALErrorServerInvalidRequestResetPasswordRequired = -50142,
};
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

MSALErrorServerInvalidRequestResetPasswordRequired is being added inside the MSALInternalError enum, but its name/value pattern (-50xxx) matches the public MSALError enum (e.g., MSALErrorServerDeclinedScopes, MSALErrorUserCanceled). This makes it easy for SDK consumers to miss it (it won’t appear as part of MSALError) and muddles the public vs internal error contract. Consider moving this constant (with a brief doc comment) into the MSALError enum section near the other server errors, and keep MSALInternalError limited to internal/debug-only codes.

Copilot uses AI. Check for mistakes.
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.

1 participant