Skip to content

[ENH] ✨ Store certificate fingerprint without prefix in inseePropriete - #989

Merged
Mandrak-Kimigo merged 1 commit into
mainfrom
988-add-certificate-fingerprint-property
Jul 27, 2026
Merged

[ENH] ✨ Store certificate fingerprint without prefix in inseePropriete#989
Mandrak-Kimigo merged 1 commit into
mainfrom
988-add-certificate-fingerprint-property

Conversation

@Mandrak-Kimigo

Copy link
Copy Markdown
Collaborator

Description

Closes #988

Keycloak's X.509 authentication module needs to look up a user from the raw SHA-256 fingerprint of the presented certificate, without knowing or reconstructing the existing certificateId$ prefix used in inseePropriete.

This PR adds the plain fingerprint <fingerprint> as a second value of the multivalued inseePropriete attribute, alongside the existing certificateId$<fingerprint> value:

  • updateUserCertificate: adds both values when a new certificate is set, and deletes both values (old fingerprint) when replacing an existing certificate.
  • deleteUserCertificate: deletes both values when removing a certificate.

Scope

  • sugoi-api-ldap-store-provider/src/main/java/fr/insee/sugoi/store/ldap/LdapWriterStore.java

Out of scope

  • No new configuration key added, no documentation update needed.
  • No test added (none existed previously for these methods).

Checklist

@Mandrak-Kimigo Mandrak-Kimigo changed the title Store certificate fingerprint without prefix in inseePropriete [ENH] ✨ Store certificate fingerprint without prefix in inseePropriete Jul 27, 2026
"inseePropriete",
"certificateId$" + certificateId))));
"certificateId$" + certificateId,
certificateId))));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it work if one of both values doesnt exist ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, you're right
I'm splitting the plain fingerprint deletion into a separate request that tolerates NO_SUCH_ATTRIBUTE, so it won't break on existing data. Pushing a fix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not working case : an existing account created before this pr with a certificate has only the certificateId$... property.
After PR, this line try to remove two values, one with, one without certificateId, but the one without certificateId doesnt exist, so the modification fails.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok, so i think we can use your new method on the previous deletion of certificateId$ to be more readable

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed — both values now go through the same tolerant deletion helper. Pushed.

#988)

Signed-off-by: Amaury Cormier <amaury.cormier@insee.fr>
Co-authored-by: Claude <noreply@anthropic.com>
@Mandrak-Kimigo
Mandrak-Kimigo force-pushed the 988-add-certificate-fingerprint-property branch from d1b367e to 1d7a95f Compare July 27, 2026 15:21
@Mandrak-Kimigo
Mandrak-Kimigo merged commit 7ac40ce into main Jul 27, 2026
8 checks passed
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.

Store the certificate's SHA-256 fingerprint without prefix in inseePropriete (Keycloak X.509 authentication support)

3 participants