Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action after_authenticate_success #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mikaelengstrom
Copy link

The hook fires after successful authentication via Azure.

Motivation
It might be useful for various cases, a developer might want to store additional Azure-data in user-meta on login. Or track info like "last login via AD" to be able to identified potentially 'dead' accounts. One might also want to set up more complex group/role-mapping rules then the plugin is capable of today

If we have this in place we could let advanced users put code like this in their application-code:

add_action('aadsso_after_authenticate_success', function($jwt, $user){
    update_user_meta($user->ID, 'azure_id', $jwt->aud);
    update_user_meta($user->ID, 'last_login_via_ad', now());
}, 2, 10);

The hook fires after successful authentifications via Azure.
It might be useful for various cases, but my primary motivation
is to store additional Azure-data in user-meta on login
@mikaelengstrom
Copy link
Author

@psignoret Do you have any thoughts on this?

@mikaelengstrom
Copy link
Author

@psignoret – Could you please review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant