Cloud orchestrator Authentication from Jenkins not working

Hi All, I’m trying to setup Jenkins, as of now -

  1. Pulling the code from Git repo - Successful
  2. Building package - Successful
  3. Deploying package to https://platform.uipath.com/tenantName/tenantName - FAILED.

Getting below error:

08.09.2019 12:16:02: Deploying C:\Program Files (x86)\Jenkins\workspace\UiPath-CICD@tmp to https://platform.uipath.com/nikhiulhzmcj/NikhilDefault/
Get-UiPathAuthToken : The operation returned an error: 1000: Invalid credentials, failed to login.
At C:\Program Files
(x86)\Jenkins\workspace\UiPath-CICD@tmp\UiPath.Extensions\1.0.7051.31454\UiPathPackage-Module.psm1:41 char:9

  •     Get-UiPathAuthToken -URL $orchestratorAddress -TenantName $te ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidResult: (:slight_smile: [Get-UiPathAuthToken], RuntimeException
    • FullyQualifiedErrorId : UiPath.PowerShell.Cmdlets.GetAuthToken

Get-UiPathAuthToken : Operation returned an invalid status code ‘BadRequest’
At C:\Program Files
(x86)\Jenkins\workspace\UiPath-CICD@tmp\UiPath.Extensions\1.0.7051.31454\UiPathPackage-Module.psm1:41 char:9

  •     Get-UiPathAuthToken -URL $orchestratorAddress -TenantName $te ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:slight_smile: [Get-UiPathAuthToken], HttpOperationException
    • FullyQualifiedErrorId : Microsoft.Rest.HttpOperationException,UiPath.PowerShell.Cmdlets.GetAuthToken

08.09.2019 12:16:05: Found 1 packages to upload to https://platform.uipath.com/nikhiulhzmcj/NikhilDefault/
Adding C:\Program Files (x86)\Jenkins\workspace\UiPath-CICD@tmp\testing123.1.0.31.nupkg
Add-UiPathPackage : An authentication token is required. Specify a value for -AuthToken on the cmdlet or call
Set-UiPathAuthToken for the session
At C:\Program Files
(x86)\Jenkins\workspace\UiPath-CICD@tmp\UiPath.Extensions\1.0.7051.31454\UiPathPackage-Module.psm1:53 char:63

  • … { Write-Host “Adding _"; Add-UiPathPackage -PackageFile "_”; Log -m …
  •                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:slight_smile: [Add-UiPathPackage], Exception
    • FullyQualifiedErrorId : System.Exception,UiPath.PowerShell.Cmdlets.AddPackage

08.09.2019 12:16:05: Package C:\Program Files (x86)\Jenkins\workspace\UiPath-CICD@tmp\testing123.1.0.31.nupkg successfully added
Finished: SUCCESS

Can you please let me know whats wrong here.

I have configured bellw in Jenkin Post-build - UiPath Deploy Section:

Orchastraor Address: https://platform.uipath.com/nikhiulzhmcj/NikhilDefault
Orchstrator Tenant: NikhilDefault

I remember testing this configuration with the platform orchestrator and it did worked for me. However in my case orchestrator url was just ‘https://platform.uipath.com’. Did you try this?

Thanks,
Rammohan B.

@Rammohan91 , thanks for your reply. Yes I tried without tenant name in orchestrator but no luck. Did you use any AuthToken configuration anywhere? Because error also does mention about AuthToken error

Add-UiPathPackage : An authentication token is required. Specify a value for -AuthToken on the cmdlet or call

Can anyone please advise if https://platform.uipath.com/Api/Account/Authenticate API is still supported for username/password login or deprecated?

Hi @nikhilbidwai,

Yes i believe its deprecated now. However ‘api/account/authenticate’ endpoint still works for me.

Here is an article for the same,

Did you use any AuthToken configuration anywhere?

Nope. I didn’t had to use any AuthToken for it.

Thanks,
Rammohan B.

@Rammohan91 Thanks for your reply!
You mentioned that ‘api/account/authenticate’ endpoint is working for you, is it working through postman? because when I tried POST https://platform.uipath.com/api/account/authenticate it doesnt work for me with my credentials.