Topic: Devise - Comparing password from home made authentication system

Hi all,

My app use Devise to authenticate users. But I must create an API with authentication mechanism who must receive a plain username and an encrypted password (SHA1).
How can I authenticate the user with the SHA1 encrypted password since devise don't use SHA1 to encrypt passwords on database ?

Thanks