Add hooks for post-authentication actions#5
Add hooks for post-authentication actions#5alxbridge wants to merge 2 commits intobradjones1:8.x-1.xfrom
Conversation
|
@alxbridge Thanks for working on this and submitting the PR. A few items: It seems like you've also linted/done code style changes here as well; I appreciate that, however I'm likely to commit that separately to make the history more atomic. More importantly, I am curious if we shouldn't fire events rather than hooks; also, hooks would need to be documented in an Regarding the post-auth hook/event, I think we could simplify that into something like: // Fire event here.
parent::completeAuth(&$state); |
|
@bradjones1 Thanks for reviewing this and for the feedback.
|
That's partly an inherent risk of using in-dev software in production, so I know the feeling though I'm also a bit unconvinced. You could implement a shim on your side to react to the event by calling your hook. Since this is the core of the PR, I'm not trying to trip you up, but I don't think adding more technical debt to the module is necessarily the way to go, either. Thoughts?
No apology needed, I might not have been as clear as I could have been. I think my point is that you have a comment in your code. I think for me to want to merge this, given our conversation thus far, I'd like to just do events. If that doesn't work for you, you're of course welcome to continue patching your local copy against your PR as it stands, or shim as above. What do you think? |
I think I did try this approach, but the function needed the code which is copied from the parent method, to be sure that the value in
I totally understand your position here, so I'm not going to push to get this merged. If I have the opportunity a bit further down the line then I'll revisit this, and I'll continue using my branch in the meantime. |
This PR creates two hooks
hook_saml_idp_login_completedandhook_saml_idp_reauthenticated, so Drupal modules can perform custom operations after successful authentication or reauthentication. These are fired from new functions forreauthenticateandcompleteAuth, overriding those from the parentSimpleSAML_Auth_Sourceclass.(There are also some code style changes as suggested by my IDE's linter.)