The credentials can now be overriden when configuring the publisher within a job. This means that you can now specify all of the properties of the Host Configuration, but leave the credentials blank - ensuring that the server can only be used if the person configuring the job can supply the required credentials.
however, nowhere does it show how to configure the credentials in a job, using declarative / script language in the Jenkinsfile. I am only able to configure a share with embedded credentials which makes the share available for anyone on the Jenkins platform to use which is not good from a security standpoint.
According to the plugin documentation
The credentials can now be overriden when configuring the publisher within a job. This means that you can now specify all of the properties of the Host Configuration, but leave the credentials blank - ensuring that the server can only be used if the person configuring the job can supply the required credentials.
however, nowhere does it show how to configure the credentials in a job, using declarative / script language in the Jenkinsfile. I am only able to configure a share with embedded credentials which makes the share available for anyone on the Jenkins platform to use which is not good from a security standpoint.
Originally reported by ajb1967, imported from: Unable to define CIFS share credentials at runtime as per documentation