aad-sso-wordpress
aad-sso-wordpress copied to clipboard
Add action after_authenticate_success
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);
@psignoret Do you have any thoughts on this?
@psignoret – Could you please review this?