diff options
author | Simo Sorce <simo@redhat.com> | 2014-03-02 18:32:06 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2014-03-02 19:11:34 -0500 |
commit | 2959e20b5607edab7313aa5ba4500c1f37358979 (patch) | |
tree | c83ce5aa7b2561dfc8eff3d7ae9fc927e1c66649 /ipsilon/providers/saml2/provider.py | |
parent | 2cf4bcfe804aaa01e4587388e0870274c20ca428 (diff) | |
download | ipsilon-2959e20b5607edab7313aa5ba4500c1f37358979.tar.gz ipsilon-2959e20b5607edab7313aa5ba4500c1f37358979.tar.xz ipsilon-2959e20b5607edab7313aa5ba4500c1f37358979.zip |
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 <simo@redhat.com>
Diffstat (limited to 'ipsilon/providers/saml2/provider.py')
-rwxr-xr-x | ipsilon/providers/saml2/provider.py | 5 |
1 files changed, 5 insertions, 0 deletions
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 |