Skip to content

Commit

Permalink
fix(authorize-idp): handle fence_idp in /authorize endpoint (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Mar 5, 2020
1 parent b7532f3 commit 1a11f2e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions fence/blueprints/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,17 @@ def authorize(*args, **kwargs):
raise UserError("idp {} is not supported".format(idp))
idp_url = IDP_URL_MAP[idp]
login_url = "{}/login/{}".format(config.get("BASE_URL"), idp_url)
if idp == "shibboleth":
shib_idp = flask.request.args.get("shib_idp")
if shib_idp:

# handle valid extra params for fence multi-tenant and shib login
fence_idp = flask.request.args.get("fence_idp")
shib_idp = flask.request.args.get("shib_idp")
if idp == "fence" and fence_idp:
params["idp"] = fence_idp
if fence_idp == "shibboleth":
params["shib_idp"] = shib_idp
elif idp == "shibboleth" and shib_idp:
params["shib_idp"] = shib_idp

login_url = add_params_to_uri(login_url, params)
return flask.redirect(login_url)

Expand Down

0 comments on commit 1a11f2e

Please sign in to comment.