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

**URL:** <https://community.nextw.com/t/how-does-nextworlds-authentication-endpoint-react-to-bad-values-passed-to-it/1208>\
**Category:** Nextworld Platform\
**Created:** [September 18, 2025, 4:49pm UTC](https://community.nextw.com/t/how-does-nextworlds-authentication-endpoint-react-to-bad-values-passed-to-it/1208 "2025-09-18T16:49:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian.p](https://sea1.discourse-cdn.com/flex001/user_avatar/community.nextw.com/ian.p/32/427_2.png) [@ian.p](https://community.nextw.com/u/ian.p)\
**Post date:** [September 18, 2025, 4:49pm UTC](https://community.nextw.com/t/how-does-nextworlds-authentication-endpoint-react-to-bad-values-passed-to-it/1208/1 "2025-09-18T16:49:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![samuel.sovereign](https://sea1.discourse-cdn.com/flex001/user_avatar/community.nextw.com/samuel.sovereign/32/149_2.png) [@samuel.sovereign](https://community.nextw.com/u/samuel.sovereign)\
**Post date:** [September 18, 2025, 6:51pm UTC](https://community.nextw.com/t/how-does-nextworlds-authentication-endpoint-react-to-bad-values-passed-to-it/1208/2 "2025-09-18T18:51:20Z")

</div>

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

```auto
{
    "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": [
                {}
            ]
        }
    ]
}

```

```auto
{
    "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": [
                {}
            ]
        }
    ]
}

```

```auto
{
    "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": [
                {}
            ]
        }
    ]
}

```
