Groovy's interpolation doc explains that why I am getting an insecure warning for my httpRequest. I used this:
withCredentials([usernamePassword(credentialsId: 'myKeys', usernameVariable: 'user', passwordVariable: 'password')]) {
def response = httpRequest url: "https://someurl",
requestBody:"grant_type=password&username=${user}&password=${password}&client_id=id4&client_secret=secret4"
}
I think my attempted fix only applies to shell commands or something but as per the doc, I tried replacing the requestBody with:
requestBody:'grant_type=password&username=$user&password=$password&client_id=id4&client_secret=secret4'
...Which returns a 401 error, implying that the $user and $password were just interpreted as non variables. Not sure how I can securely use the withCredentials method without interpolation. Thank you for the help.