> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/troubleshooting/authentication/troubleshooting-login-failed-with-login-sequence.md).

# Troubleshoot login failed with login sequence

In targets with authentication, Snyk API & Web must log in to reach areas reserved for authenticated users. If scans fail to log in using a login sequence for complex authentication flows, follow these troubleshooting steps.

## The problem

When running scans on a target that uses a login sequence to complete a complex authentication flow, Snyk API & Web fails to log in.

## Troubleshoot the problem

Work through the following step to identify possible causes and solutions.

### Check the login sequence

Verify the JSON of the login sequence is still valid.

1. Navigate to the **Targets** page.
2. Click the **gear icon** for the target to access settings.
3. Open the **Authentication** tab and review the **LOGIN SEQUENCE** configuration.
4. Download the JSON of the login sequence.
5. Open a browser, navigate to the target's URL, and follow the login flow.
6. On each step of the login flow:
   1. Right-click and select **Inspect** to obtain the attributes or CSS selectors that identify the input fields.
   2. Note those attributes or CSS selectors and the values used in the input fields.
7. In the JSON of the login sequence, validate the following:
   1. The sequence follows the login flow.
   2. The attributes or CSS selectors defined to identify the input fields are correct.
   3. The values defined for use in the input fields are correct.

If the JSON does not reflect the login flow, Snyk API & Web cannot authenticate.

Check the following causes and solutions:

| Cause                                                                          | Solution                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The login sequence does not follow the login flow.                             | Record a new login sequence and update it in target authentication. Visit [Login sequence](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication/configure-login-sequence.md).                                |
| Input fields in the login sequence have incorrect attributes or CSS selectors. | Record a new login sequence and update it in target authentication. Visit [Login sequence](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication/configure-login-sequence.md).                                |
| Input fields in the login sequence have incorrect values.                      | Record a new login sequence with correct credential values and update it in target authentication. Visit [Login sequence](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication/configure-login-sequence.md). |

After following these steps and applying the solutions, Snyk can log in to your target.

For more information, visit [Configure authentication](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/troubleshooting/authentication/troubleshooting-login-failed-with-login-sequence.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
