Skip to content
Snippets Groups Projects
Commit 6db5d180 authored by ale's avatar ale
Browse files

Autodetect path prefix for SSO endpoints

parent 0adba647
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,14 @@ def init_sso(app, talisman):
app.config['SSO_SERVICE'], app.config['SSO_DOMAIN'],
app.config.get('SSO_GROUPS'))
app.add_url_rule('/sso_login', 'sso_login', _sso_login)
app.add_url_rule('/sso_logout', 'sso_logout',
# Install handlers for the SSO HTTP endpoints (sso_login and
# sso_logout). We assume that the app is served at the domain root
# (/), and attempt to derive the endpoints path prefix by looking
# at the SSO_SERVICE, in case we need to set up authentication on
# a subdirectory of the site only.
service_path = app.sso_service[app.sso_service.find('/'):]
app.add_url_rule(service_path + 'sso_login', 'sso_login', _sso_login)
app.add_url_rule(service_path + 'sso_logout', 'sso_logout',
talisman(frame_options=ALLOW_FROM,
frame_options_alow_from='*')(_sso_logout))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment