For the complete documentation index, see llms.txt. This page is also available as Markdown.

Authentication for Visual Studio extension

How to authenticate the Snyk Visual Studio extension, including the supported protocols

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 to map these options to the new interface.

Authentication for Visual Studio extension

To scan your Projects, you must authenticate with Snyk.

Snyk supports the following protocols for authentication:

  • OAuth 2.0 (Recommended)

  • Personal Access Token

  • API token (Legacy)

Authentication methods available in the Snyk extension in Visual Studio
Authentication methods available in the Snyk extension in Visual Studio

Steps to authenticate using the OAuth 2.0 protocol

Follow the next steps to authenticate:

  1. After the extension is installed, navigate to Extensions > Snyk > Windows, and then Snyk to open the Snyk panel.

Snyk extension navigation
Snyk extension navigation
  1. On the welcome screen, click Trust project and scan.

Trust project and scan
Trust project and scan
  1. A new browser window opens, requiring you to log in to your Snyk account.

  2. In the next prompt, the Snyk IDE extension requests access to act on your behalf. Click Grant app access.

  3. When you have authenticated successfully, a confirmation message appears. Close the browser window and return to the IDE.

The analysis starts automatically. The IDE reads and saves the authentication on your local machine.

You might encounter the browser redirecting to 127.0.0.1:8080. This is normal, and you would need to retry the steps above.

Browser redirect to the local callback address during OAuth authentication

OAuth 2.0 tokens are not static and cannot be copied from the Snyk account page.

If you have problems, see OAuth 2.0 authentication does not work.

Steps to authenticate using your Personal Access Token

Snyk recommends authenticating with OAuth 2.0. It is the default method for the Snyk IDE plugins, and its tokens are not static. Use token authentication only where OAuth 2.0 is not available to you.

To authenticate using the Personal Access token, follow these steps:

  1. Navigate to Preferences > Snyk.

  2. Set the flag to Use Personal Access Token.

    Authenticating the Visual Studio extension with a Personal Access Token
  3. Click the Connect IDE to Snyk button.

  4. Create your Personal Access Token. For details, see the Authentication for API page.

  5. Paste or enter the token in the Token field.

  6. Click Apply and Close.

Steps to authenticate using your Snyk API token

Snyk recommends authenticating with OAuth 2.0. It is the default method for the Snyk IDE plugins, and its tokens are not static. Use token authentication only where OAuth 2.0 is not available to you.

Follow these steps to authenticate:

  1. After the extension is installed, navigate to Extensions > Snyk > Settings:

Snyk Settings navigation
Snyk Settings navigation
  1. Find the Authentication Method and change it to API Token authentication.

    Selecting the API token authentication method
  2. Click the Connect IDE to Snyk button.

  3. Click Authenticate in the web browser window that opens.

    Authenticating the Visual Studio extension with a Snyk API token
  4. The API token is automatically updated in the API Token field.

  5. Click Apply and Close.

The analysis starts automatically.

Alternatively, copy the personal API token from your Snyk Web UI instance (default is https://app.snyk.io). Paste the token in the API Token field. For details, see Obtain and use your Snyk API token.

How to switch accounts

To re-authenticate with a different account, follow these steps:

  1. Navigate to Extensions > Snyk > Settings.

  2. Clear the value of the Token field.

  3. Click OK.

  4. When you have logged out, start authentication again from the beginning.

Last updated

Was this helpful?