Skip to main content
Delphix

Resolving API Login Failure With An "ambiguous username" Error (KBA5817)

 

 

KBA

KBA# 5817

 

Issue

When authenticating to the Delphix Engine (virtualization) API , using an API call like this:

 

$ curl -s -X POST -k --data @- http://delphix-server/resources/json/delphix/login \

   -b ~/cookies.txt -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
{
   "type": "LoginRequest",
   "username": "delphix_username",
   "password": "delphix_password"
}

EOF

 

You may receive a response like this:

{"type":"ErrorResult","status":"ERROR","error":{"type":"APIError","details":"Ambiguous username.","action":"Add a @DOMAIN or 
@SYSTEM suffix to the username.","id":"exception.login.ambiguous","commandOutput":null}}

This means that the user name you are using to login exists for both an Engine Setup user (the same type as the pre-definedsysadminuser) and a Delphix Management user (the same type as the pre-defined admin or delphix_admin user). 

However, the suggested action of adding @DOMAIN or @SYSTEM to the user name will not work for logging in to the API. 

Applicable Delphix Versions

Click here to view the versions of the Delphix engine to which this article applies
Major Release All Sub Releases
6.0 6.0.0.0, 6.0.1.0, 6.0.1.1, 6.0.2.0

5.3

5.3.0.0, 5.3.0.1, 5.3.0.2, 5.3.0.3, 5.3.1.0, 5.3.1.1, 5.3.1.2, 5.3.2.0, 5.3.3.0, 5.3.3.1, 5.3.4.0, 5.3.5.0 5.3.6.0, 5.3.7.0, 5.3.7.1, 5.3.8.0, 5.3.8.1, 5.3.9.0

5.2

5.2.2.0, 5.2.2.1, 5.2.3.0, 5.2.4.0, 5.2.5.0, 5.2.5.1, 5.2.6.0, 5.2.6.1

5.1

5.1.0.0, 5.1.1.0, 5.1.2.0, 5.1.3.0, 5.1.4.0, 5.1.5.0, 5.1.5.1, 5.1.6.0, 5.1.7.0, 5.1.8.0, 5.1.8.1, 5.1.9.0, 5.1.10.0

5.0

5.0.1.0, 5.0.1.1, 5.0.2.0, 5.0.2.1, 5.0.2.2, 5.0.2.3, 5.0.3.0, 5.0.3.1, 5.0.4.0, 5.0.4.1 ,5.0.5.0, 5.0.5.1, 5.0.5.2, 5.0.5.3, 5.0.5.4

4.3

4.3.1.0, 4.3.2.0, 4.3.2.1, 4.3.3.0, 4.3.4.0, 4.3.4.1, 4.3.5.0

4.2

4.2.0.0, 4.2.0.3, 4.2.1.0, 4.2.1.1, 4.2.2.0, 4.2.2.1, 4.2.3.0, 4.2.4.0 , 4.2.5.0, 4.2.5.1

4.1

4.1.0.0, 4.1.2.0, 4.1.3.0, 4.1.3.1, 4.1.3.2, 4.1.4.0, 4.1.5.0, 4.1.6.0

Resolution

To resolve the ambiguous user error when logging into the API, add an additional property target to the JSON LoginRequest object passed to the login API call, with the value DOMAIN or SYSTEM. So for the example above, using curl to access the API, the corrected version would look like:

$ curl -s -X POST -k --data @- http://delphix-server/resources/json/delphix/login \
   -b ~/cookies.txt -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
{
   "type": "LoginRequest",
   "username": "delphix_username",
   "password": "delphix_password",
   "target": "DOMAIN"
}
EOF

It is always acceptable to specify the target when logging into the API, regardless of whether there are multiple users of different types with the user name you are using.

 


Related Articles

The following articles may provide more information or related information to this article: