projects
/
cascardo
/
ipsilon.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix NameId exception
[cascardo/ipsilon.git]
/
ipsilon
/
providers
/
saml2
/
provider.py
diff --git
a/ipsilon/providers/saml2/provider.py
b/ipsilon/providers/saml2/provider.py
index
7d47363
..
c44c8b8
100755
(executable)
--- a/
ipsilon/providers/saml2/provider.py
+++ b/
ipsilon/providers/saml2/provider.py
@@
-33,8
+33,8
@@
class InvalidProviderId(ProviderException):
class NameIdNotAllowed(Exception):
class NameIdNotAllowed(Exception):
- def __init__(self):
- message = '
The specified Name ID is not allowed'
+ def __init__(self
, id
):
+ message = '
Name ID [%s] is not allowed' % id
super(NameIdNotAllowed, self).__init__(message)
self.message = message
super(NameIdNotAllowed, self).__init__(message)
self.message = message
@@
-144,6
+144,14
@@
class ServiceProvider(object):
return username.split('@', 1)[0]
return username
return username.split('@', 1)[0]
return username
+ def is_valid_nameid(self, value):
+ if value in SAML2_NAMEID_MAP:
+ return True
+ return False
+
+ def valid_nameids(self):
+ return SAML2_NAMEID_MAP.keys()
+
class ServiceProviderCreator(object):
class ServiceProviderCreator(object):