Development #48784
auth_saml/mellon: pas de log d'erreur quand un attribut requis manque
Début:
24 novembre 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
J'ai une configuration mellon de ce genre :
"A2_ATTRIBUTE_MAPPING": [ {"action": "rename", "from": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname", "to": "givenname"}, {"action": "rename", "from": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname", "to": "surname"}, {"action": "rename", "from": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress", "to": "email"}, {"attribute": "first_name", "saml_attribute": "givenname", "mandatory": true}, {"attribute": "last_name", "saml_attribute": "surname", "mandatory": true}, {"attribute": "email", "saml_attribute": "email", "mandatory": true}, {"action": "toggle-role", "role": {"name": "Connexion ADFS"}} ],
Quand on reçoit une assertion SAML où il manque http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname, on a ces logs :
INFO connexion-xxx.test.entrouvert.org 176.31.123.109 - r:7F330213E198 Got SAML Response INFO connexion-xxx.test.entrouvert.org 176.31.123.109 entrou r:7F330213E198 auth_saml: attribute 'first_name' set to 'entrouvert' WARNING connexion-xxx.test.entrouvert.org 176.31.123.109 - r:7F330213E198 no user found for NameID 'entrouvert-test1'
A aucun moment n'apparait de message comme quoi il manque 'surname' (renommé 'last_name')
(Aussi, un peu étonnant : malgré ce manque d'un attribut requis, un utilisateur semble commencer à être créé avec l'attribut first_name... Puis, en fin de process, on a un "no user found" qui devrait plutôt être "cannot create user" mais bon, c'est sans doute lié au fait que le lookup créé aussi l'utilisateur)
Fichiers
Demandes liées
Révisions associées
Historique
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Lié à Bug #50825: auth_saml : les erreurs de provisionning à la création de l'utilisateur ne sont pas journalisées ajouté
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
Lors du provisionning d'un utilisateur existant, c'est bien journalisé :
def provision(self, user, idp, saml_attributes): super(AuthenticAdapter, self).provision(user, idp, saml_attributes) try: self.provision_a2_attributes(user, idp, saml_attributes) except MappingError as e: logger.warning('auth_saml: failure during attribute provisionning %s', e)
mais pour un utilisateur nouveau, non et ça nous perd :
def finish_create_user(self, idp, saml_attributes, user): try: self.provision_a2_attributes(user, idp, saml_attributes) except MappingError as e: raise UserCreationError('user creation failed on a mandatory mapping action: %s' % e) if not user.ou: user.ou = get_default_ou() user.save()
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Fichier 0001-auth_saml-log-mapping-errors-during-user-creation-48.patch 0001-auth_saml-log-mapping-errors-during-user-creation-48.patch ajouté
- Tracker changé de Support à Development
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Serghei Mihai il y a environ 3 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 1c8c8117ff60f17cd130690c328fd44828f490db Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Wed Feb 3 20:39:39 2021 +0100 auth_saml: log mapping errors during user creation (#48784)
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
auth_saml: log mapping errors during user creation (#48784)