Python API // 2-Factor Auth

We are encountering issues during human API authentication to the Shotgrid Python API with 2FA.

sg = Shotgun("", login="loginemail", password="legacypasswoord"), auth_token="shotgridpersonalaccesstoken")

I found topics here saying it worked for other people but the only api response we are getting is:

> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>ken="the auth token" 
>   File "~/shotgun_api3/", line 715, in __init__
>     self.config.session_token = self.get_session_token()
>   File "~/shotgun_api3/", line 3235, in get_session_token
>     rv = self._call_rpc("get_session_token", None)
>   File "~/shotgun_api3/", line 3423, in _call_rpc
>     self._response_errors(response)token="the auth token" ion 
>   File "~/shotgun_api3/", line 3722, in _response_errors
>     raise AuthenticationFault(sg_response.get("message", "Unknown Authentication Error"))
> shotgun_api3.shotgun.AuthenticationFault: Cant authenticate user 'email login'

The token has been connected on the SG user setting page

We also already tried using the 6-digit code from the authenticator app as auth_token value without any succes.

Somebody has a clue why this is not working?

Thanks in advance,

You need to use the login name, not perse the email.

Old user accounts created before the move to Autodesk Identity will likelyu have a username that is not teh users email but just the first bit.

Hi Ricardo,

A while ago but forgot to mark this issue as solved.
Thank you for pointing me into the right direction.


1 Like