diff --git a/authserv/auth.py b/authserv/auth.py
index 904631eab9aef54af40d562b079db709e1bf9816..87c0349fd5bf00fe296dfe456c46db8933269e56 100644
--- a/authserv/auth.py
+++ b/authserv/auth.py
@@ -34,6 +34,9 @@ def authenticate(user, service, password, otp_token):
     if not password:
         return protocol.ERR_AUTHENTICATION_FAILURE
 
+    if isinstance(password, unicode):
+        password = password.encode('utf-8')
+
     if user.app_specific_passwords_enabled():
         if _check_app_specific_password(user.get_app_specific_passwords(service),
                                         password) == protocol.OK: