> 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

How to troubleshoot a failed login with a login sequence in Snyk API & Web

{% hint style="info" %}
**Snyk is rolling out a new navigation.** The steps on this page describe the classic interface. If your view looks different, visit [Navigate the Snyk Web UI](https://docs.snyk.io/navigate-the-snyk-web-ui#where-things-moved) to map these options to the new interface.
{% endhint %}

## 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
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=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
