Commit c9f36a4e authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fix saml issues after domain name changes.

parent 07f4167b
......@@ -687,7 +687,9 @@ def index():
# based on machine's hostname use different base URL for redirection
# TODO switch to use environment variables: PRODUCTION, TESTING, DEVELOPMENT
if hostname == 'enc-production-nomad':
return_to = ''
return_to = ''
elif hostname == 'enc-production-hv-nomad':
return_to = ''
return_to = '%sgui/' % request.host_url
# return_to = '%sgui/' % request.host_url
......@@ -739,7 +741,7 @@ def index():
"expires_in": session['token_expires_in']}}
# production and staging machines have different domain names
# and the cookie should be set on the corresponding domain name
if hostname == 'enc-production-nomad':
if hostname == 'enc-production-nomad' or hostname == 'enc-production-hv-nomad':
response.set_cookie('user_info', json.dumps(cookie_data), domain='')
response.set_cookie('user_info', json.dumps(cookie_data), domain='')
......@@ -789,7 +791,10 @@ def index():
# paint_logout=paint_logout
# )
if 'samlUserdata' in session:
return redirect(url_for('api.user_attrs'))
# Added 'api' string as a quick fix for redirection to /saml/user/ after the user is authenticated.
# Before the fix the url was which doesn't exists (because should be
# and nginx redirected to the /gui and not showing the user's details, token ...
return redirect('api' + url_for('api.user_attrs'))
return redirect(auth.login())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment