Search code examples
javamavenintellij-ideaintellij-pluginsnyk

IntelliJ IDE MissingApiTokenError: `snyk` requires an authenticated account. Please run `snyk auth` and try again


I have installed the snyk vulnerability analysis plugin on my IntelliJ IDE , but when i try to run the analysis , it gives me error as below :

enter image description here

Although i understand it is asking me to provide some auth credentials for my snyk server , but i am not able to understand where to provide it in the IDE . I tried to see if i can find any options to set the snyk auth from IDE toolbar , but i could not find any . Does anyone has an idea how to solve this issue ?


Solution

  • Not a very polished plug-in with regard to installation, I must say; apparently they just expect you to know that their CLI tool must be installed in order to be able to use the plug-in. No mention of that on the JetBrains Marketplace Snyk plug-in page.

    But from the error message I just guessed and went ahead: Installation instructions for the CLI tool.

    For example, if you have Homebrew installed, run this from the CLI:

    • brew tap snyk/tap && brew install snyk
    • snyk auth

    enter image description here

    I later found out that the need for their CLI tool is mentioned on their support page about the plug-in, though. But it says there ‘The plugin will automatically download the CLI in the background.’

    Once the CLI tool is installed, the plugin is a joy to use:

    enter image description here