Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions shotgun_api3/shotgun.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ class UserCredentialsNotAllowedForSSOAuthenticationFault(Fault):
"""
pass

class UserCredentialsNotAllowedForOxygenAuthenticationFault(Fault):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 2 blank lines, found 1

"""
Exception when the server is configured to use Oxygen. It is not possible to use
a username/password pair to authenticate on such server.
"""
pass

# ----------------------------------------------------------------------------
# API

Expand Down Expand Up @@ -3384,6 +3391,7 @@ def _response_errors(self, sg_response):
ERR_AUTH = 102 # error code for authentication related problems
ERR_2FA = 106 # error code when 2FA authentication is required but no 2FA token provided.
ERR_SSO = 108 # error code when SSO is activated on the site, preventing the use of username/password for authentication.
ERR_OXYG = 110 # error code when Oxygen is activated on the site, preventing the use of username/password for authentication.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least two spaces before inline comment


if isinstance(sg_response, dict) and sg_response.get("exception"):
if sg_response.get("error_code") == ERR_AUTH:
Expand All @@ -3394,6 +3402,10 @@ def _response_errors(self, sg_response):
raise UserCredentialsNotAllowedForSSOAuthenticationFault(
sg_response.get("message", "Authentication using username/password is not allowed for an SSO-enabled Shotgun site")
)
elif sg_response.get("error_code") == ERR_OXYG:
raise UserCredentialsNotAllowedForOxygenAuthenticationFault(
sg_response.get("message", "Authentication using username/password is not allowed for an Autodesk Identity enabled Shotgun site")
)
else:
# raise general Fault
raise Fault(sg_response.get("message", "Unknown Error"))
Expand Down