Skip to content

Connexion: Permettre de forcer la mise à jour du sub d'un compte SSO pour lequel l'email est associé à un autre sub. - #6146

Merged
tonial merged 2 commits into
masterfrom
alaurent/sub_update
May 20, 2025
Merged

Connexion: Permettre de forcer la mise à jour du sub d'un compte SSO pour lequel l'email est associé à un autre sub.#6146
tonial merged 2 commits into
masterfrom
alaurent/sub_update

Conversation

@tonial

@tonial tonial commented May 16, 2025

Copy link
Copy Markdown
Contributor

🤔 Pourquoi ?

Parfois un utilisateur se connecte avec France Connect ou PE Connect et on voit arriver un email connu (également associé au même SSO) mais avec un sub différent.

Peut être qu'ils distinguent les emails sur la case, autorisant un compte test@gmail.com et TEST@gmail.com. Peut être que l'ancien compte a été supprimé ou a changé d'email puis un nouveau compte a été créé avec l'email.

En tout cas, on est bloqué, et on voudrait permettre à l'utilisateur dont on a vérifié l'identité (pour s'assurer que ce n'est pas un compte partagé) de se connecter sans devoir faire plusieurs actions en ligne de commande.

J'ajoute donc un bouton dans l'admin pour permettre la mise à jour du sub à la prochaine connexion.

🍰 Comment ?

Décrivez en quelques mots la solution retenue et mise en oeuvre, les difficultés ou problèmes rencontrés. Attirez l'attention sur les décisions d'architecture ou de conception importantes.

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?
  • Ajouter l'étiquette « Bug » ?

🏝️ Comment tester ?

Les instructions pour reproduire le problème, les profils de test, le parcours spécifique à utiliser, etc. Si vous disposez d'une recette jetable, mettre l'URL pour tester dans cette partie.

💻 Captures d'écran

@tonial
tonial requested review from EwenKorr and leo-naeka May 16, 2025 11:25
@tonial tonial self-assigned this May 16, 2025
@tonial tonial added the modifié Modifié dans le changelog. label May 16, 2025
@tonial
tonial force-pushed the alaurent/sub_update branch from ec04865 to 8b23736 Compare May 16, 2025 11:47
Comment thread itou/users/models.py
@tonial
tonial force-pushed the alaurent/sub_update branch 2 times, most recently from 2b5742f to e9bff54 Compare May 16, 2025 12:13

@EwenKorr EwenKorr left a comment

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.

LGTM mais ma connaissance limitée dans le mécanisme de SSO me pousse à laisser quelqu'un d'autre valider

@tonial
tonial force-pushed the alaurent/sub_update branch 2 times, most recently from 1e5f540 to 2a138a3 Compare May 19, 2025 05:07
Comment thread itou/users/admin.py Outdated
Comment thread itou/openid_connect/models.py
@tonial
tonial force-pushed the alaurent/sub_update branch 2 times, most recently from b568e8a to 7a34ec3 Compare May 19, 2025 09:52
@tonial
tonial requested a review from leo-naeka May 19, 2025 09:53
@tonial
tonial force-pushed the alaurent/sub_update branch from 7a34ec3 to 35b3628 Compare May 19, 2025 13:21

@leo-naeka leo-naeka left a comment

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.

Te laisse trancher sur la dernière remarque :)

Comment thread itou/users/admin.py Outdated
Comment on lines +512 to +513
assert fieldsets[-1][1]["fields"][11] == "identity_provider"
fieldsets[-1][1]["fields"].insert(12, "allow_next_sso_sub_update")

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.

nit: les assert sur les groupes vont bien comme ça, mais pour simplifier la gestion dans le temps, que penses-tu de simplement récupérer la position d'identity_providerpour insérer le champ ?

Suggested change
assert fieldsets[-1][1]["fields"][11] == "identity_provider"
fieldsets[-1][1]["fields"].insert(12, "allow_next_sso_sub_update")
identity_provider_index = fieldsets[-1][1]["fields"].index("identity_provider")
fieldsets[-1][1]["fields"].insert(identity_provider_index + 1, "allow_next_sso_sub_update")

@tonial
tonial force-pushed the alaurent/sub_update branch from 35b3628 to 5ad7736 Compare May 19, 2025 14:26
tonial added 2 commits May 19, 2025 20:59
Sometimes, a SSO returns us the same email with a different sub (maybe
they store case sensitive emails , of the old account was deleted and
the user created a new one).
Allow the support team to fix the issue for a given user.
@tonial
tonial force-pushed the alaurent/sub_update branch from 5ad7736 to 70ee94c Compare May 19, 2025 19:04
@tonial
tonial added this pull request to the merge queue May 20, 2025
Merged via the queue into master with commit 7819ab4 May 20, 2025
@tonial
tonial deleted the alaurent/sub_update branch May 20, 2025 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modifié Modifié dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants