WBradney035779 (Community Member) asked a question.

Can't authenticate from Azure Devops pipeline using ID/Key

I have a Veracode@2 Azure Devops pipeline task with ConnectionDetailsSelection 'Credentials", and the username and password set to the api id and secret configured on my account.

 

I get:

##errorBuild Failed : Error occurred while accessing the Veracode Platform.

 

(node:2972) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'OldBuildId' of null

 

When I use the same credentials in TeamCity (with Credentials Type = API/Key), it works.

TeamCity offers both API/Key and Username/Password as options for credentials, but Azure only offers "Credentials (Username/Password)" and "Endpoint".


  • rmachado (Veracode, Inc.)

    Hello @WBradney035779 (Community Member)​ 

     

    When you created your connection did you select 'Endpoint' and then 'Veracode authentication'?

     

    If you've done that and are still having issues. There could be something wrong with your credentials.

    While your credentials may work, if the resources that you are trying to access were created after the credentials had already been created, the credentials will not be able to access the resource and you will get the error.

     

    Can you please try the credentials using our API wrappers. 

     

    You can either download the Java or C# wrapper and try your API creds. Please do the following:

     

    1. Download the wrapper - https://help.veracode.com/r/orRWez4I0tnZNaA_i0zn9g/s0qc3PCFxqBF~fzkFrc20Q

    2. Save the unzipped file to a location on your machine.

    3. Open a command line interface and navigate to to the directory where VeracodeC#API.exe or VeracodeJavaAPI.jar is.

    4. run the executable or jar. If you download the C# wrapper, the syntax should look something like this - VeracodeC#API -action getapplist -vid *** -vkey *** 

     

    Please make sure the application you are trying to reach is shown in the response. If your credentials fail, please generate new credentials - https://help.veracode.com/search/all?query=Generate+Veracode+API+Credentials&content-lang=en-US, update your VSTS credentials and try again.

     

    If your credentials are working but the issue in VSTS continues, the issue will need to be further investigated. If this is the case, please submit an email to support@veracode.com, with the subject - VSTS integration support. In the email please provide 1. the full log of the error, 2. the name of the user who's credentials are being used.

     

    Regards.

    Expand Post
    Selected as Best
  • WBradney035779 (Community Member)

    UPDATE: doesn't work with my account credentials, either. Same error message.

  • WBradney035779 (Community Member)

    UPDATE: I created a service connection in Azure Devops using the id and key, and hooked up my yaml using the 'Endpoint' mode, and it fails with the same error.

  • rmachado (Veracode, Inc.)

    Hello @WBradney035779 (Community Member)​ 

     

    When you created your connection did you select 'Endpoint' and then 'Veracode authentication'?

     

    If you've done that and are still having issues. There could be something wrong with your credentials.

    While your credentials may work, if the resources that you are trying to access were created after the credentials had already been created, the credentials will not be able to access the resource and you will get the error.

     

    Can you please try the credentials using our API wrappers. 

     

    You can either download the Java or C# wrapper and try your API creds. Please do the following:

     

    1. Download the wrapper - https://help.veracode.com/r/orRWez4I0tnZNaA_i0zn9g/s0qc3PCFxqBF~fzkFrc20Q

    2. Save the unzipped file to a location on your machine.

    3. Open a command line interface and navigate to to the directory where VeracodeC#API.exe or VeracodeJavaAPI.jar is.

    4. run the executable or jar. If you download the C# wrapper, the syntax should look something like this - VeracodeC#API -action getapplist -vid *** -vkey *** 

     

    Please make sure the application you are trying to reach is shown in the response. If your credentials fail, please generate new credentials - https://help.veracode.com/search/all?query=Generate+Veracode+API+Credentials&content-lang=en-US, update your VSTS credentials and try again.

     

    If your credentials are working but the issue in VSTS continues, the issue will need to be further investigated. If this is the case, please submit an email to support@veracode.com, with the subject - VSTS integration support. In the email please provide 1. the full log of the error, 2. the name of the user who's credentials are being used.

     

    Regards.

    Expand Post
    Selected as Best
  • WBradney035779 (Community Member)

    I was able to get it working with the Service Connection in Endpoint mode. I recreated the api id and key.

Topics (2)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.