PlagueHO / jenkins

PowerShell module for interacting with a CloudBees Jenkins server using the Jenkins Rest API.
MIT License
11 stars 28 forks source link

Authentication on Linux using PSCore 7.0.0+ is broken #5

Open matthorgan opened 4 years ago

matthorgan commented 4 years ago

Running the Jenkins Module on WSL or Linux using PowerShell 7.0.0+ causes an authentication error similar to the below:

Error 401 Invalid password/token for user:***********  HTTP ERROR 401 Invalid password/token for user:*********** 
     | URI:/job/terraform-clients/createItem STATUS:401 MESSAGE:Invalid password/token for user:***********

This is due to the method the password is decrypted being broken and not advised (See here).

Suggest we move to using something like this instead which will fix the Module for Linux: $Password = $Credential.GetNetworkCredential().Password