From 2959e20b5607edab7313aa5ba4500c1f37358979 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 2 Mar 2014 18:32:06 -0500 Subject: Add ability to strip domain/realm per provider This allows to return (hopefully) the same name whether the user authenticated via ESSO or form based authentication. Crude for now, may be augmented with some regex configuration in the future. Signed-off-by: Simo Sorce --- ipsilon/providers/saml2/provider.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ipsilon/providers/saml2/provider.py') diff --git a/ipsilon/providers/saml2/provider.py b/ipsilon/providers/saml2/provider.py index c738ac2..acf2ee7 100755 --- a/ipsilon/providers/saml2/provider.py +++ b/ipsilon/providers/saml2/provider.py @@ -106,3 +106,8 @@ class ServiceProvider(object): def _debug(self, fact): if cherrypy.config.get('debug', False): cherrypy.log(fact) + + def normalize_username(self, username): + if 'strip domain' in self._properties: + return username.split('@', 1)[0] + return username -- cgit