Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/buildapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def app_pair(global_conf, load_app_kwds=None, wsgi_preflight=True, **kwargs):

# Authentication endpoints.
if app.config.enable_oidc:
webapp.add_route("/authnz/", controller="authnz", action="index", provider=None)
webapp.add_route("/authnz/", controller="authnz", action="index", provider=None, redirect=None)
webapp.add_route("/authnz/{provider}/login", controller="authnz", action="login", provider=None)
webapp.add_route("/authnz/{provider}/callback", controller="authnz", action="callback", provider=None)
webapp.add_route(
Expand Down
7 changes: 5 additions & 2 deletions lib/galaxy/webapps/galaxy/controllers/authnz.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def index(self, trans, **kwargs):

@web.json
@web.expose
def login(self, trans, provider, idphint=None, next=None):
def login(self, trans, provider, idphint=None, next=None, redirect=None):
if not trans.app.config.enable_oidc:
msg = "Login to Galaxy using third-party identities is not enabled on this Galaxy instance."
log.debug(msg)
Expand All @@ -90,7 +90,10 @@ def login(self, trans, provider, idphint=None, next=None):
trans.set_cookie(value="/", name=LOGIN_NEXT_COOKIE_NAME)
success, message, redirect_uri = trans.app.authnz_manager.authenticate(provider, trans, idphint)
if success:
return {"redirect_uri": redirect_uri}
if redirect and redirect.lower() == "true":
return trans.response.send_redirect(redirect_uri)
else:
return {"redirect_uri": redirect_uri}
else:
raise exceptions.AuthenticationFailed(message)

Expand Down
Loading