Get Auth Token for user-client only

The ZetaSafe API uses a ZetaSafe authorisation token for authentication. The typical login process is to login, select a role, and then select a Client.

In some circumstances, you might need to get an auth token for a user and a specific Client quickly, without going through the typical process.

This API will return a valid auth token if the username and password are valid, and the user has an Admin role to the requested Client.

If the user is authenticated, but does not have an admin role for the requested client, a list of usernames which do poses admin credentials for the client will be returned.

This token can be got by POSTing username, password together with adding the QueryString adminClientId to the URL.

A successful call will result in a Body response with a token included. This is the x-auth-token relating to the users Admin role.

{
    "token":null,
    "admins":[]
}

If the users username and password are authenticated, but they do not have an min role for the client, a list of ** admins** will be displayed. This is a list of ZetaSafe usernames which the user might find helpful to identify a user with sufficient access.

URI

Query Paramaters:

  • adminClientId

The ** adminClientId** parameter is required and should be set as documented

Development

https://api.zetasafe.net/dev/ext/userclientauthtoken/get

Production

https://api.zetasafe.net/ext/userclientauthtoken/get

Method

POST

Content Type

application/json

Responses:

200: Success

Get the new x-auth-token from the token in the JSON response

400: Bad Request - Possible Responses:

  • the username and password are correct but the user does not have access to the role or client provided.

  • password has expired {“PASSWORD_EXPIRED” : “[message]“}

  • user has no applicable role for the mobile app (only has read-only roles for example) {“USER_HAS_NO_APPLICABLE_ROLE” : “[message]“}

  • no access to role {“NO_ACCESS_TO_ROLE”:“Access denied”}

  • no access to client {“NO_ACCESS_TO_CLIENT”:“Access denied”}

  • internal server error processing the provided roleId / clientId {“UNEXPECTED_ERROR”:“Access denied”}

401: Unauthorised

The username / password are incorrect

500: Internal Error