At the moment there's no way to have a request to user.logout trigger a CAS logout. Obviously this is not essential for all applications, but it would a nice configurable option.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | cas_2536128_11.patch | 11.46 KB | yalet |
| #8 | cas_2536128_8.patch | 5.39 KB | caseyfw |
| #6 | cas_2536128_6.patch | 4.16 KB | caseyfw |
| #5 | 2536128_5.patch | 6.32 KB | yalet |
| #3 | cas_2536128_3.patch | 7.16 KB | pingers |
Comments
Comment #1
caseyfw commentedAdds the "Drupal Logout Triggers CAS Logout" configuration item and adds a logout request handler to the Kernel Event subscriber.
The mechanism used to trigger a CAS logout is to simply fire a redirect to the cas.logout route. This isn't the most ideal solution because it means a request to /user/logout results in two successive 302 redirects. A better solution would be an internal forward to LogoutController::logout(), but I have no idea how to do that. I tried creating a request and adding it to the request stack, but no dice.
Comment #2
caseyfw commentedForgot to include logic to test if user session was authenticated through CAS. This fixes that issue.
During login, an "auth_provider" attribute is set to "cas" on the session. This is then used as the determinant when the user does a /user/logout to determine if a redirection to /caslogout should occur.
If anyone can think of a better way to do this, I'm all ears, but we kind of need a way to determine "was this session authenticated with CAS?"
Comment #3
pingers commentedRe-rolled the patch against latest build...
Comment #4
yalet commentedI think we want a Route enhancer here to make the same logical check and switch the controller to the cas logout controller. I have to dig into this some more. We also store the session ID hashes of cas-authenticated sessions in the database for single sign out purposes (which is not fully implemented yet anyway), so we could look up sessions that way.
Comment #5
yalet commentedHere's a patch that implements what I was talking about in my comment: a route enhancer and lookup from the database.
Comment #6
caseyfw commentedRe-rolled patch for current head. Removed trailing whitespace and maintenance_access config from routing.yml.
Comment #7
yalet commentedI think your patch is missing the class file that actually declares the route enhancer (probably didn't add the file to git before patch generate?).
Comment #8
caseyfw commentedAwww, dammit. Yeah, sorry - new to the patch workflow.
Comment #9
yalet commentedThis is going to need to be reworked a little, based on what we decided about SLO and storing cas-authenticated session identifiers. This doesn't affect the mechanics of the logout redirect, only the method of checking whether we have a cas session or not.
Comment #10
yalet commentedActually, no. We can just add a column for non-hashed session id when we implement SLO and leave this alone.
Comment #11
yalet commentedAdded some tests.
Comment #13
yalet commentedCommitted, thanks everyone.