Skip to content

Conversation

@mastro993
Copy link
Contributor

@mastro993 mastro993 commented Nov 26, 2025

Short description

This PR introduces the L2+ flow for IT-Wallet. L2+ adds an extra step after the primary SPID or CieID identification, requiring the user to complete an MRTD (ID card) proof-of-possession check.
The verification is performed through an NFC scan of the ID card.

This PR also includes a major refactoring of the CIE scan logic, making it reusable and shareable across both the CIE+PIN and MRTD flows.

List of changes proposed in this pull request

Credential Issuance Flow & Proof Handling

  • Added support for selecting proof type (mrtd-pop or none) during credential issuance, controlled by the new withMRTDPoP parameter in startAuthFlow, and updated related function signatures and logic in itwIssuanceUtils.ts. [1] [2] [3]
  • Improved validation in getCredentialIdentifierFromAccessToken to throw an error for unsupported authorization detail types, increasing robustness.

MRTD PoP Challenge Utilities

  • Introduced the mrtd.ts utility with functions for initializing and validating MRTD PoP challenges, encapsulating cryptographic context management and challenge handling.

NFC Feature Detection & L3 Flow

  • Simplified L3 feature detection by checking for level === "l3" directly instead of using a helper, and updated related tests and screens to reflect this logic. [1] [2]
  • Updated the discovery component to use wallet lifecycle validity for determining whether to start in "upgrade" or "issuance" mode, improving flow control.

Localization & Dependency Updates

  • Updated Italian localization strings for credential issuance modes to clarify durations and hints.
  • Upgraded the @pagopa/io-react-native-wallet dependency to version 2.4.0 for access to new features and bug fixes.

Error Handling & Analytics

  • Refactored the CIE card read failure content to improve error tracking, analytics integration, and retry handling, making the component more robust and customizable. [1] [2]

How to test

  • With the IT-Wallet whitelist flag disabled:
    • Verify that all identification methods (CIE+PIN, SPID, CieID) behave as before and no regressions are introduced.
  • With the IT-Wallet whitelist flag enabled:
    • Verify that the CIE+PIN identification flow still works correctly and without regressions.
    • Verify that it is possible to obtain an L3 PID using SPID or CieID through the MRTD PoP flow.

Demo

SPID + CIE CieID + CIE
ScreenRecording_11-26-2025.16-37-24_1.MP4
ScreenRecording_11-26-2025.16-38-33_1.MP4

…thentication flow

- Deleted unused files related to the CIE machine context and selectors.
- Refactored the CIE card reader screen to utilize the new authentication flow.
- Introduced a new CIE authentication screen to handle the authentication process.
- Updated the internal authentication and MRTD screen to integrate with the new CIE manager.
- Enhanced the CIE manager to handle reading progress and errors more effectively.
- Added utility functions for progress visualization during CIE reading.
- Updated navigation parameters and actions to align with the new flow.
- Improved type safety and error handling across the CIE authentication process.
@mastro993 mastro993 self-assigned this Nov 26, 2025
@mastro993 mastro993 marked this pull request as ready for review November 26, 2025 15:53
@github-actions
Copy link
Contributor

PR Title Validation for conventional commit type

All good! PR title follows the conventional commit type.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

Jira Pull Request Link

This Pull Request refers to Jira issues:

Copy link
Collaborator

@gispada gispada left a comment

Choose a reason for hiding this comment

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

LGTM

@ale-mazz ale-mazz added this pull request to the merge queue Dec 4, 2025
Merged via the queue into master with commit a981cac Dec 4, 2025
23 checks passed
@ale-mazz ale-mazz deleted the SIW-3045-add-l2-plus-pid-issuance-flow branch December 4, 2025 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants