Keystone should propagate redirect exceptions from auth plugins

Bug #1854041 reported by Alvaro Lopez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
Alvaro Lopez

Bug Description

When a developer is implementing an Authentication plugin [1] they can only return None and setup the relevant information in the auth context or raise an Unauthorized exception. However, in some cases (like an OpenID Connect plugin) it is needed to perform a redirect to the provider to complete the flow. IIRC this was possible in the past (before moving to Flask) by raising an exception with the proper HTTP code set, but with the current implementation this is impossible.

[1]: https://docs.openstack.org/keystone/latest/contributor/auth-plugins.html

Revision history for this message
Colleen Murphy (krinkle) wrote :

It would be great to get more information, like the link to the code for your auth plugin so that someone can reproduce it, and specifics on which versions of keystone this used to work for. If this behavior changed when Flask was introduced, that's definitely a regression we should fix.

Changed in keystone:
status: New → Incomplete
Revision history for this message
Alvaro Lopez (aloga) wrote :

Hi Colleen.

Sorry for my silence.

The code for the plugin (work in progress) is here: https://github.com/IFCA/keystone-oidc-auth-plugin/

Revision history for this message
Colleen Murphy (krinkle) wrote :

Alvaro, can you confirm what version of keystone you were using when this worked for you, and what version you're using now that doesn't work?

Revision history for this message
Alvaro Lopez (aloga) wrote :

Hi Collen.

Unfortunately I do not remember the version, but it was before Flask's migration, IIRC. Currently we are testing with the R, S and T releases.

Best.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Identity (keystone) because there has been no activity for 60 days.]

Changed in keystone:
status: Incomplete → Expired
Colleen Murphy (krinkle)
Changed in keystone:
status: Expired → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.opendev.org/754694

Changed in keystone:
assignee: nobody → Alvaro Lopez (aloga)
status: Confirmed → In Progress
Revision history for this message
Alvaro Lopez (aloga) wrote :

Any chances that this bug (and solution) gets some attention?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.opendev.org/c/openstack/keystone/+/754694
Committed: https://opendev.org/openstack/keystone/commit/1c106f48b05d45e87ecdfbda1586d9456d818f7e
Submitter: "Zuul (22348)"
Branch: master

commit 1c106f48b05d45e87ecdfbda1586d9456d818f7e
Author: ferag <email address hidden>
Date: Thu Nov 21 11:34:40 2019 +0000

    Propagate redirect exceptions to the client

    When a developer is implementing an Authentication plugin, in some cases
    (like an OpenID Connect plugin) it is needed to perform a redirect to
    the provider to complete the flow. This was possible in the past (before
    moving to Flask) by raising an exception with the proper HTTP code set,
    but the framework change made this possibility not available anymore.

    Closes-Bug: #1854041
    Co-authored-by: Alvaro Lopez Garcia <email address hidden>
    Change-Id: I333eb15c66f37207e6937d0cb3a80f26cf9bebfc

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 25.0.0.0rc1

This issue was fixed in the openstack/keystone 25.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.