How does Nextworld's authentication endpoint react to bad values passed to it

If I call /v2/Authenticate/Tokens with valid credentials but pass in an invalid value for Tenant or Environment or Lifecycle, how does the platform respond to those invalid inputs?

I assume you are talking purely about /v2/Authenticate/Tokens, not with the additional query params ?login or ?refreshas the behavior is different.
If you have an invalid Tenant, Environment or Lifecycle you will get the following responses respectively with a 401 code:

{
    "ErrorMessages": [
        {
            "ErrorType": "Error",
            "ErrorSubType": "nwsysauthenticationexception",
            "ErrorCode": "TOKEN_REFRESH_FAILED",
            "ErrorDescription": "Token refresh failed. Caused by: Invalid tenant for user: <tenant name>",
            "ErrorStyle": null,
            "ErrorPayload": [],
            "ErrorTechnicalDetails": null,
            "ErrorDetails": {
                "LogicBlockStackTrace": []
            },
            "ErrorFields": [
                {}
            ]
        }
    ]
}
{
    "ErrorMessages": [
        {
            "ErrorType": "Error",
            "ErrorSubType": "nwsysauthenticationexception",
            "ErrorCode": "TOKEN_REFRESH_FAILED",
            "ErrorDescription": "Token refresh failed. Caused by: The environment <environment name> is invalid for the tenant <user tenant>.",
            "ErrorStyle": null,
            "ErrorPayload": [],
            "ErrorTechnicalDetails": null,
            "ErrorDetails": {
                "LogicBlockStackTrace": []
            },
            "ErrorFields": [
                {}
            ]
        }
    ]
}
{
    "ErrorMessages": [
        {
            "ErrorType": "Error",
            "ErrorSubType": "nwsysauthenticationexception",
            "ErrorCode": "TOKEN_GENERATION_FAILED",
            "ErrorDescription": "Token generation failed. Caused by: Invalid lifecycle.",
            "ErrorStyle": null,
            "ErrorPayload": [],
            "ErrorTechnicalDetails": null,
            "ErrorDetails": {
                "LogicBlockStackTrace": []
            },
            "ErrorFields": [
                {}
            ]
        }
    ]
}
3 Likes