Skip to content

Authenticate an account

authAccount checks the self-care portal credentials of an account of the authenticated customer and returns the account’s ID. Use it to log your users in on your own website or app with the same login and password as in the portal.

The method supports trusted mode with i_customer, the customer that owns the account.

Name Type Required Description
username string one of Web login of the account
email string one of email of the account, used instead of username
password string yes Web password, or a one-time password from resetAccountOneTimePassword
Name Type Description
result string OK
i_account int ID of the authenticated account
request
call("authAccount", {"username": "1001", "password": "kq7Rm2xVt9Lp"})
response
{"result": "OK", "i_account": 3092}

A login with a one-time password succeeds with a fault, so handle code 410 separately:

request
import xmlrpc.client
try:
i_account = call("authAccount", {"username": "1001", "password": otp})["i_account"]
except xmlrpc.client.Fault as f:
if f.faultCode == 410:
ask_for_new_password() # logged in with a one-time password
else:
raise
faultCode faultString Cause
410 Not an error: the account was authenticated with a one-time password. Ask the user to set a new password
More than one account matched Several accounts have this email. Log in with username instead