aad-sso-wordpress icon indicating copy to clipboard operation
aad-sso-wordpress copied to clipboard

Add action after_authenticate_success

Open mikaelengstrom opened this issue 6 years ago • 2 comments

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);

mikaelengstrom avatar Mar 01 '18 11:03 mikaelengstrom

@psignoret Do you have any thoughts on this?

mikaelengstrom avatar Mar 13 '18 14:03 mikaelengstrom

@psignoret – Could you please review this?

mikaelengstrom avatar Apr 25 '19 07:04 mikaelengstrom