> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ulm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication Errors

These are the most common error cases and error codes returned by the [Authenticate User](c_authenticateUser) Process.

## Invalid Credentials

If the user provides an invalid credentials (e.g., an invalid authn ID or password), and the client passes that along to the Process, then the Process responds with a `HTTP 401` status code. The body includes a `operationErrors` array with the reason(s) as to what went wrong:

```
**ERROR RESPONSE - body**
{
   "processId": "49819a56-5b81-49a0-8d26-2b39d7ce3859",
   "stepName": "StartStep",
   "operationErrors": [
      {
         "code": "authentication-required",
         "type": "com.uxpsystems.mint.framework.ulm.process.exception.LoginFailureException",
         "message": "Bad credentials"
      }
   ],
   "lastStep": false,
   "lastFailedStepAction": {
      "processId": "49819a56-5b81-49a0-8d26-2b39d7ce3859",
      "stepName": "ReEnterPrompt",
      "parameters": {
         "authnIdentifier": "String",
         "credential": "String"
      }
   }
}
```

The Process error response also includes a `lastStepFailedAction` object that repeats the previous Process step's request. The user can re-attempt their request with the correct authN ID and password.

| `processId` | The unique identifier for this instance of the Process. |
| - | - |
| `stepName` | The internal name of the step that the Process is currently on / just executed. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `OperationErrors` | Array of possible error objects. Each object describes a separate error condition. |
| `code` | The name of the specific field where the error occurred. |
| `type` | An error object's internal code name. |
| `message` | The actual value that caused the error |
| `lastFailedStepAction` | Object that repeats the previous Process step's details and required input. This allows the client to easily retry the failed request. |

## Invalid MFA Code

During Authentication with MFA, if the user enters an invalid verification code (and/or the client submits an incorrect Proof Key for Action Token), the Process responds with an `HTTP 401` status code. The response body includes an `operationErrors` array with the reason(s) as to what went wrong:

```
**RESPONSE - body**
{
   "operationErrors": [
      {
         "code": "invalid-code",
         "message": "Invalid code",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ],
   "processId": "eec918ff-5db4-4fee-a601-5ff76a099c8e",
   "lastStep": false,
   "processName": "authentication.AuthenticateUser.v1.0",
   "stepName": "TwoFACodePrompt",
   "lastFailedStepAction": {
      "processId": "eec918ff-5db4-4fee-a601-5ff76a099c8e",
      "processName": "authentication.AuthenticateUser.v1.0",
      "stepName": "TwoFACodePrompt",
      "displayMessage": "Please input required information",
      "output": {
         "pkat": "babec3b7-96b5-47f4-b697-4683820d55af",
         "attemptsRemaining": 4
      },
      "parameters": {
         "code": "String",
         "pkat": "String",
         "trustedDevice": "Boolean"
      }
   }
}
```

The Process error response also includes a `lastStepFailedAction` object that repeats the previous Process step's request. The user can make sure they entered the correct MFA code, retry their request, and complete the Process as usual.

| `processId` | The unique identifier for this instance of the Process. |
| - | - |
| `stepName` | The internal name of the step that the Process is currently on / just executed. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `operationErrors` | Array of possible error objects. Each object describes a separate error condition. |
| `code` | The name of the specific field where the error occurred. |
| `type` | An error object's internal code name. |
| `message` | The actual value that caused the error |
| `lastFailedStepAction` | Object that repeats the previous Process step's details and required input. This allows the client to easily retry the failed request. |

## Error Codes

Below is a list of potential error codes that may be returned during the execution of this Process.

**Note:** See [Common Process Error Codes](c_commonProcessErrors).

| HTTP Status | Digital Identity Management Error Code | Description |
| - | - | - |
| `401` | `user-profile-locked` | The User is temporarily locked. |
| `401` | `authentication-required` | One or more of the below is true:- Authentication identifier is not valid - Credential (password) is not valid - User not found - reCAPTCHA verification code is not valid |
| `401` | `user-activating` | The authentication identifier provided is in an `activating` status.By default, this Process only allows authentication with `activated` (i.e., verified) authN IDs. |
| `401` | `invalid-code` | The Process prompted the user for a MFA code, but the provided code was invalid. |
| **Parent topic:**[Authenticate User Process](../topics/c_authenticateUser) | | |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.