Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59573

Non-stored password parameter not working in freestyle project

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hello everyone.

      I just created freestyle project that should execute shell (bash) and use Non-stored password parameter. But Non-stored password parameter value is complete ignored.

      I added regular Password parameter just for testing. I got this with masking passwords.
      Running as SYSTEM
      Building in workspace /root/.jenkins/workspace/test
      [test] $ /bin/bash /opt/tomcat/temp/jenkins3125009081352009458.sh
      pass1 is ********
      pass2 is
      Finished: SUCCESS
      Without masking I got this.
      Running as SYSTEM
      Building in workspace /root/.jenkins/workspace/test
      [test] $ /bin/bash /opt/tomcat/temp/jenkins3721571884155122083.sh
      pass1 is test123
      pass2 is
      Finished: SUCCESS
       

      Script is :

      #!/bin/bash

      echo pass1 is ${Password}
      echo pass2 is ${Password2}

      exit 0

       

      'Password' is Password Parameter and Password2 is Non-stored Password Parameter.

       

      I have some pipeline on same jenkins using mask passwords plugin and it works correctly there.

       

      Any help would be appreciated.

        Attachments

          Activity

          Hide
          santustats26 santhosh voodem added a comment -

          could you please let me know if this issue got resolved. I am facing same issue for both kind of password parameters

          Show
          santustats26 santhosh voodem added a comment - could you please let me know if this issue got resolved. I am facing same issue for both kind of password parameters
          Hide
          ncourbet Nicolas added a comment -

          Hello, I faced the same issue and discovered it was linked to the case. You need to use upper case PASSWORD and PASSWORD2.
          From the git repo, PasswordParameterValue.java#L59:

          env.put(name.toUpperCase(), value != null ? Secret.toString(value) : null); 
          

           

          Show
          ncourbet Nicolas added a comment - Hello, I faced the same issue and discovered it was linked to the case. You need to use upper case PASSWORD and PASSWORD2. From the git repo, PasswordParameterValue.java#L59 : env.put(name.toUpperCase(), value != null ? Secret.toString(value) : null );  

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            vladaurosh Vlad Uros
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: