does System.login works with a user whose password expired

Hi,

           I need log the user on my api as service user, I was thinking to use System.login action as it doesn't require the password as input. does this action logs the user even if user's password has expired?

thanks in advance.

Hello Ravindra.

No, you can't login as an expired user. It will return the standard "Invalid user or password".

Inactive users is as if they don't exist at all. They are only kept because they have probably been used in external entities (like Logs).

Also, remember that System.Login is used to impersonate a user. It should only be used after user1 authenticated himself and then impersonate user2.