Skip to content

Commit c40ba8d

Browse files
Andreas RichterAndreas Richter
authored andcommitted
SAML Authenticate not recognizing sessioninfo during initial authentication.
1 parent 1cd3275 commit c40ba8d

File tree

1 file changed

+3
-1
lines changed
  • src/s2repoze/plugins

1 file changed

+3
-1
lines changed

src/s2repoze/plugins/sp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def identify(self, environ):
490490
if ("CONTENT_LENGTH" not in environ or not environ["CONTENT_LENGTH"]) and \
491491
"SAMLResponse" not in query and "SAMLRequest" not in query:
492492
logger.debug('[identify] get or empty post')
493-
return {}
493+
return None
494494

495495
# if logger:
496496
# logger.info("ENVIRON: %s" % environ)
@@ -652,6 +652,8 @@ def _service_url(environ, qstr=None):
652652
#noinspection PyUnusedLocal
653653
def authenticate(self, environ, identity=None):
654654
if identity:
655+
if identity.get('user') and environ.get('s2repoze.sessioninfo') and identity.get('user') == environ.get('s2repoze.sessioninfo').get('ava'):
656+
return identity.get('login')
655657
tktuser = identity.get('repoze.who.plugins.auth_tkt.userid', None)
656658
if tktuser and self.saml_client.is_logged_in(decode(tktuser)):
657659
return tktuser

0 commit comments

Comments
 (0)