> ## 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.

# Register authenticator app errors

These are the basic errors and error cases with the [Register Authenticator App](c_registerAuthnApp) Process.

## Invalid password

This Process always requires the user to first provide a password (unless the user [onboarded with a social account](c_onboardAuthenticateUserSocial) and uses that account passwordless authentication), even though they are already authenticated. If the user provides an invalid password, the Process returns this response:

```
**RESPONSE - body**
{
   "processId": "7e034cfd-85fb-464c-a995-8eee3acb98c2",
   "processName": "userManagement.registerAuthenticatorAppAsMFA.v1.0",
   "stepName": "PasswordPrompt",
   "lastStep": false,
   "operationErrors": [
      {
         "code": "invalid-credential",
         "type": "com.uxpsystems.mint.framework.ulm.process.service.ServiceStep.GeneralFailure",
         "message": "Bad credentials",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ],
   "lastFailedStepAction": {
      "processId": "7e034cfd-85fb-464c-a995-8eee3acb98c2",
      "processName": "userManagement.registerAuthenticatorAppAsMFA.v1.0",
      "displayMessage": "Please provide your password.",
      "parameters": {
         "password": "String"
      }
   }
}
```

The response also includes a `lastStepFailedAction` object that repeats the previous Process step's response, so that the user can re-attempt to submit a valid password.

## Invalid verification code

After they are prompted to provide the verification code from the authenticator app, if the user provides an invalid code, the Process returns this response:

```
**RESPONSE - body**
{
   "processId": "7e034cfd-85fb-464c-a995-8eee3acb98c2",
   "processName": "userManagement.registerAuthenticatorAppAsMFA.v1.0",
   "lastStep": false,
   "stepName": "TotpVerificationPrompt",
   "operationErrors": [
      {
         "code": "invalid-code",
         "message": "Invalid code",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ],
   "lastFailedStepAction": {
      "processId": "7e034cfd-85fb-464c-a995-8eee3acb98c2",
      "processName": "userManagement.registerAuthenticatorAppAsMFA.v1.0",
      "displayMessage": "Please provide the Google Authentication verification code by scanning the QR Url provided.",
      "parameters": {
         "code": "String"
      },
      "output": {
         "attemptsRemaining": 4,
         "qrUrl": otpauth://totp/ryan%40example.com?secret=zapCVtcIXg"
      }
   }
}
```

The response also includes a `lastStepFailedAction` object that repeats the previous Process step's response, so that the user can re-attempt to submit the valid code.

## Exceeded max attempts

When the user is prompted to provide the verification code form the authenticator app, the number of allowed attempts remaining is displayed in the `output` object, named `attemptsRemaining`. The user is free to make additional attempts until this limit is reached, at which point the Process terminates. The user (or the client) will need to initiate the Process again:

```
**RESPONSE - body**
{
   "processId": "7e034cfd-85fb-464c-a995-8eee3acb98c2",
   "processName": "userManagement.registerAuthenticatorAppAsMFA.v1.0",
   "stepName": "TotpVerificationPrompt"
   "lastStep": false,
   "operationErrors": [
      {
         "code": "process-terminated-with-too-many-retries",
         "type": "com.uxpsystems.mint.framework.ulm.process.service.ServiceStep.GeneralFailure",
         "message": "User exceeded the max number of tries",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ]
}
```

| `processId` | The unique identifier for this instance of the Process. |
| - | - |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `lastFailedStepAction` | Object that repeats the previous Process step's details and required input. This allows the client to essentially retry the failed request. |
| `operationErrors` | Array of possible error objects. Each object describes a separate error condition. |
| `code` | An error object's internal code name. |
| `type` | Internal reference of the operation error type. |
| `message` | Optional message that describes the error in a human readable format. |
| `authorities` | The list of authority roles currently granted to the user. Can be used to help supply context to authorization errors (i.e. a process requires a user to be authenticated to Digital Identity Management, however they are an "anonymous", or unauthenticated user). |
| `stepName` | The internal name of the step that the Process is currently on / just executed. |

## 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 Business Error Code | Description |
| - | - | - |
| `400` | `process-terminated-with-too-many-retries` | The process was terminated due to exceeding a retry limit. |
| `400` | `user-without-authnid` | The user attempted to register TOTP two-factor authentication but their profile does not have an authentication identifier associated with it. |
| `400` | `password-unset` | The user does not have a set password. In order to add a second factor, the user must first set a password (i.e., [Update Password Process](c_updatePassword)). |
| `401` | `invalid-code` | The code provided from the authenticator application was invalid. |

**Parent topic:**[Register Authenticator App Process](../topics/c_registerAuthnApp)


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