Skip to content

feat(pro-connect): enable 2fa in ProConnect idp#162

Open
Rhmaric wants to merge 5 commits into
InseeFr:masterfrom
Rhmaric:feat/pro-connect-2fa
Open

feat(pro-connect): enable 2fa in ProConnect idp#162
Rhmaric wants to merge 5 commits into
InseeFr:masterfrom
Rhmaric:feat/pro-connect-2fa

Conversation

@Rhmaric

@Rhmaric Rhmaric commented Apr 23, 2026

Copy link
Copy Markdown

Summary

This pull request adds optional two-factor authentication (2FA) for the ProConnect (AgentConnect) identity provider.

Realm administrators can enable Double authentification (2FA) in the ProConnect identity provider settings. When it is on, the provider negotiates MFA with ProConnect using an OIDC claims parameter (with the ACR values expected for ProConnect 2FA) instead of acr_values, and it validates the acr claim returned on the ID token against the allowed MFA assurance levels.

eIDAS level and 2FA are complementary, not mutually exclusive:

  • 2FA off — unchanged behavior: acr_values is set from the configured eIDAS level (eidas1, eidas2, or eidas3), with the existing minimum-level validation on callback.
  • 2FA on — the configured eIDAS level sets the minimum assurance among MFA-capable ACR values sent in claims and accepted on callback:

Screenshot

ProConnect identity provider settings with the 2FA toggle enabled

Testing

  • ./mvnw test (unit tests), including new coverage for MFA authorization URLs and ACR validation.

Rhmaric and others added 3 commits April 23, 2026 08:01
Adds an admin toggle for ProConnect (AgentConnect) to require MFA via OIDC claims, validates returned ACR for MFA flows, and extends tests.

Made-with: Cursor
Keeps FranceConnect/AgentConnect expectations for missing or unknown ACR values. Sets config enabled for MFA test fixtures (Keycloak requires an enabled provider).

Made-with: Cursor
@Rhmaric

Rhmaric commented Apr 23, 2026

Copy link
Copy Markdown
Author

Implementation note:

Adds ProConnect 2FA guidance in README FR and README EN, references the official implementation guide, and documents known IdP compatibility limitations.

Made-with: Cursor
@Rhmaric Rhmaric force-pushed the feat/pro-connect-2fa branch from 930350b to decdd12 Compare April 23, 2026 06:28
Comment thread README.en.md Outdated
This implementation follows the official ProConnect guide for service providers:
https://partenaires.proconnect.gouv.fr/docs/fournisseur-service/double_authentification

When this option is enabled, the authorization request uses an OIDC `claims` parameter to request one of the supported ACR values (`eidas2`, `eidas3`, `self-asserted-2fa`, `consistency-checked-2fa`) and the returned `acr` claim is validated on callback.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The supported acr values supported are evolving : https://partenaires.proconnect.gouv.fr/docs/fournisseur-identite/niveaux-assurance-eidas
We should directly use the newest values and remove self-asserted-2fa and consistency-checked-2fa
(Evolution checked with dinum)

@clement-dufaure

clement-dufaure commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Implementation note:

* this 2FA behavior was built by following the official ProConnect guide for service providers: [https://partenaires.proconnect.gouv.fr/docs/fournisseur-service/double_authentification\n\nCompatibility](https://partenaires.proconnect.gouv.fr/docs/fournisseur-service/double_authentification%5Cn%5CnCompatibility)

* 2FA is not supported by all ProConnect identity providers. The list of compatible identity providers is available here: https://grist.numerique.gouv.fr/o/docs/3kQ829mp7bTy/ProConnect-Configuration-des-FI-et-FS/p/5

Latest version of proconnect documentation around auth levels :

.add()
.property().name(AgentConnectIdentityProviderConfig.MFA_ENABLED_PROPERTY_NAME)
.label("Double authentification (2FA)")
.helpText("Active la double authentification ProConnect. Quand activé, le niveau eIDAS ci-dessous est ignoré et les valeurs ACR ProConnect 2FA (eidas2, eidas3, self-asserted-2fa, consistency-checked-2fa) sont utilisées.")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Potentiellement on pourrait demander d'un coté le mfa mais d'autre part au moins le niveau eidas1, soit une requete de claims:acr:[eidas1-mfa;eidas2;eidas3]
Donc soit on passe carrément à une liste d'acr acceptés (dans le formulaire une simple liste, plus flexible mais peut être moins lisible)

Soit on reste sur un champ booleen activer MFA et un champ niveau eidas, et on cumule les 2 dans la requete, (il faudrait rajouter eidas0 à l'occasion d'une autre PR), cad si on choisit niveau eidas1 et on active mfa, la requete contient claims:acr:[eidas1-mfa;eidas2;eidas3]

(après on peut laisser comme ça pour une première version et affiner ce point ultérieurement)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Salut @clement-dufaure,
Je viens seulement de voir tes retours sur la PR. Je n'avais pas vu que la documentation avait évoluée...

Il est indiqué d'ailleurs : "Ces niveaux sont provisoires et seront définitifs au T2 2026. Vous pouvez commencer à les implémenter pour être MFA-ready". Faut-il comprendre qu'avec ces acr claims cela ne marche pas encore ?

Parce qu'avec self-asserted-2fa et consistency-checked-2fa cela fonctionne en tout cas. On l'utilise sur la connexion au back-office DossierFacile pour exiger une double-authentification.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Salut @clement-dufaure,

La mention de niveaux "provisoires" a disparu de la doc https://partenaires.proconnect.gouv.fr/docs/fournisseur-service/double_authentification

Et l'équipe ProConnect me dit que l'on peut désormais utiliser les eidas0-mfa et eidas1-mfa.

Je te propose de faire un commit pour s'aligner sur ça !

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello ! Je confirme qu'à ProConnect on vient tout juste de faire cette évolution majeure qui supprime les ACR https://proconnect.gouv.fr/assurance/self-asserted-2fa https://proconnect.gouv.fr/assurance/consistency-checked-2fa pour les remplacer par leurs équivalents standardisés eidas0-mfa et eidas1-mfa (plus d'infos sur la norme eidas dans notre doc)

Il est donc possible de supprimer les occurrences de ces ACR au profit des nouveaux.

Une communication globale sera faite avant l'été à nos partenaires Fournisseurs d'Identité pour leur annoncer la bonne nouvelle et de pouvoir configurer leur FI pour être MFA-compliant :)

@Rhmaric

Rhmaric commented Jul 2, 2026

Copy link
Copy Markdown
Author

Bonjour @clement-dufaure,

Je viens de proposer des changements en prenant en compte les nouveaux ACR ProConnect. Je te confirme également que ces changements ont été testés en production sur DossierFacile (connexion opérateur back-office) et que cela fonctionne correctement.

Bien à toi,

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