I am running the following code but get correct login regardless of what password I use. How can I get this to work?
$creds = array();
$creds['user_login'] = $username;
$creds['user_password'] = $password;
$creds['remember'] = true;
$user = wp_signon( $creds, false );
if (is_wp_error($user))
{
header('HTTP/1.0 401 Unauthorized');
}