Fix tabs + indents mix
This commit is contained in:
@@ -108,8 +108,8 @@ def saml2_handler(session, request, config_filename = None, entityid = None):
|
|||||||
config_filename = config_filename or os.path.join(request.folder,'private','sp_conf')
|
config_filename = config_filename or os.path.join(request.folder,'private','sp_conf')
|
||||||
client = Saml2Client(config_file = config_filename)
|
client = Saml2Client(config_file = config_filename)
|
||||||
if not entityid:
|
if not entityid:
|
||||||
idps = client.metadata.with_descriptor("idpsso")
|
idps = client.metadata.with_descriptor("idpsso")
|
||||||
entityid = idps.keys()[0]
|
entityid = idps.keys()[0]
|
||||||
bindings = [BINDING_HTTP_REDIRECT, BINDING_HTTP_POST]
|
bindings = [BINDING_HTTP_REDIRECT, BINDING_HTTP_POST]
|
||||||
binding, destination = client.pick_binding(
|
binding, destination = client.pick_binding(
|
||||||
"single_sign_on_service", bindings, "idpsso", entity_id=entityid)
|
"single_sign_on_service", bindings, "idpsso", entity_id=entityid)
|
||||||
@@ -120,7 +120,7 @@ def saml2_handler(session, request, config_filename = None, entityid = None):
|
|||||||
if not request.vars.SAMLResponse:
|
if not request.vars.SAMLResponse:
|
||||||
req_id, req = client.create_authn_request(destination, binding=binding)
|
req_id, req = client.create_authn_request(destination, binding=binding)
|
||||||
relay_state = web2py_uuid().replace('-','')
|
relay_state = web2py_uuid().replace('-','')
|
||||||
session.saml_outstanding_queries = {req_id: request.url}
|
session.saml_outstanding_queries = {req_id: request.url}
|
||||||
session.saml_req_id = req_id
|
session.saml_req_id = req_id
|
||||||
http_args = client.apply_binding(binding, str(req), destination,
|
http_args = client.apply_binding(binding, str(req), destination,
|
||||||
relay_state=relay_state)
|
relay_state=relay_state)
|
||||||
@@ -150,14 +150,14 @@ class Saml2Auth(object):
|
|||||||
self.config_file = config_file
|
self.config_file = config_file
|
||||||
self.maps = maps
|
self.maps = maps
|
||||||
|
|
||||||
# URL for redirecting users to when they sign out
|
# URL for redirecting users to when they sign out
|
||||||
self.saml_logout_url = logout_url
|
self.saml_logout_url = logout_url
|
||||||
|
|
||||||
# URL to let users change their password in the IDP system
|
# URL to let users change their password in the IDP system
|
||||||
self.saml_change_password_url = change_password_url
|
self.saml_change_password_url = change_password_url
|
||||||
|
|
||||||
# URL to specify an IDP if using federation metadata or an MDQ
|
# URL to specify an IDP if using federation metadata or an MDQ
|
||||||
self.entityid = entityid
|
self.entityid = entityid
|
||||||
|
|
||||||
def login_url(self, next="/"):
|
def login_url(self, next="/"):
|
||||||
d = saml2_handler(current.session, current.request, entityid=self.entityid)
|
d = saml2_handler(current.session, current.request, entityid=self.entityid)
|
||||||
|
|||||||
Reference in New Issue
Block a user