Fix password flow authentication

Fixed procedure for password flow authentication