My goal was to add a filter as following:
add_filter( 'authenticate', 'myplugin_auth_signon', 30, 3 );
function myplugin_auth_signon( $user, $username, $password ) {
return $user;
}
In this case the parameter $username is always null. I analyzed the code of plugin ‘external-db-auth-reloaded’ and I see that the parameter is set to null.
I solved the problem. with ‘wp_authenticate_user’. In this cas I have the username.
add_filter( 'wp_authenticate_user', 'checkCodeFilter', 10, 2);