Issue
I have a Jenkinsfile that needs to ask for a password.
I have the following:
def password = input message: 'Please enter the password', parameters: [string(defaultValue: '', description: '', name: 'password')]
The problem is that the field shows up the characters in Jenkins when I type them in meaning anyone looking over my shoulder can see them.
The value is also logged clearly in the logfile.
Is there a way that I can:
- mask the characters as they are typed in the field?
- hide the value in the log file?
Solution
@hayderimran7 was almost there but did not address my comment in his answer so posting it here.
Use a password
parameter as following:
input message: 'enter password', parameters: [password(defaultValue: 'value', description: '', name: 'hidden')]
Answered By - wimnat
Answer Checked By - Terry (JavaFixing Volunteer)