The CasValidator validates the ticket coming from CAS for both versions (1 and 2). In doing so, it creates a CasPropertyBag with the data coming from CAS (username and attributes mainly). However, some CAS servers return data in a different way, have extra keys etc and that data might need to be used.

What we should do is create a new event that can be dispatched at that moment to allow other modules to intercept this process and add data into the property bag according to their specific needs.

Comments

Upchuk created an issue. See original summary.

ieguskiza’s picture

Status: Active » Needs review
StatusFileSize
new7.53 KB

I uploaded a patch to provide the described functionality

Status: Needs review » Needs work

The last submitted patch, 2: 2997099-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ieguskiza’s picture

StatusFileSize
new13.05 KB

Tried fixing failing tests and added a new test.

upchuk’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: 2997099-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

bkosborne’s picture

This is a dup of #2988477: Allow altering property bag from validate response. and both patches use the same method to resolve, but this one has tests, so I will close that one in favor of this one and give credit to that issue creator as well.

I'm curious what type of data is actually in that CAS validation response that's needed. I tried to follow the CAS protocol as closely as possible and I don't think the protocol accounts for such extra information that could be passed in the validation response. That said, this is obviously a needed feature so I support it going in.

upchuk’s picture

Ah, did not find that issue.

Yeah we are dealing with a CAS response that returns the email for example in some weird location, not following the CAS protocol properly I guess. So I assume there are other cases out there as well. So we created this solution to allow various uses cases.

bkosborne’s picture

Ok. I will review this weekend. Thanks for providing the patch.

ieguskiza’s picture

Status: Needs work » Needs review
StatusFileSize
new13.09 KB

Hopefully this patch will be green, I found out some very stupid mistakes I left in the previous patch (and the tests are green in my local installation).

Status: Needs review » Needs work

The last submitted patch, 11: 2997099-11.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ieguskiza’s picture

StatusFileSize
new13.08 KB

So php5.6 doesn't allow to type hint scalar types :(
Hopefully this makes the patch green.

ieguskiza’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 13: 2997099-13.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ieguskiza’s picture

Status: Needs work » Needs review
StatusFileSize
new13.06 KB

A bit hard to debug this since I use php7 :( Sorry for all the noise.

upchuk’s picture

Status: Needs review » Reviewed & tested by the community

I tested this, works well. Now the CAS server can return unicorns, modules can read that as they please and turn it into attributes.

bkosborne’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new13.05 KB
new3.23 KB

Thanks for all the work! Only modification I made was to rename the event from CasAfterValidateEvent to CasPostValidateEvent, which matches the naming convention used for the other events (which use Pre instead of Before).

Will commit once these tests pass.

  • bkosborne committed efb687b on 8.x-1.x authored by ieguskiza
    Issue #2997099 by ieguskiza, bkosborne, Upchuk, b_sharpe: Allow the...
bkosborne’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.