# Jenkins CasC credentials issue

**URL:** <https://community.jenkins.io/t/jenkins-casc-credentials-issue/24565>\
**Category:** Ask a question\
**Tags:** question, casc\
**Created:** [December 10, 2024, 1:27pm UTC](https://community.jenkins.io/t/jenkins-casc-credentials-issue/24565 "2024-12-10T13:27:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oj4wipro](https://avatars.discourse-cdn.com/v4/letter/o/eb8c5e/32.png) [@oj4wipro](https://community.jenkins.io/u/oj4wipro)\
**Post date:** [December 10, 2024, 1:27pm UTC](https://community.jenkins.io/t/jenkins-casc-credentials-issue/24565/1 "2024-12-10T13:27:46Z")

</div>

I have a CasC configuration to setup some credentials like this

```auto
credentials:
  system:
    domainCredentials:
      - credentials:
        - basicSSHUserPrivateKey:
            id: "jenkins-ssh-key"
            description: "SSH-Key"
            scope: "GLOBAL"
            username: "jenkins"
            passphrase: ""
            privateKeySource:
              directEntry:
                privateKey: "${readFile:/secrets/id_rsa}"

        - usernamePassword:
            id: "jenkins-oauth-consumer"
            description: "OAuth-Consumer"
            scope: "GLOBAL"
            usernameSecret: true
            username: "${readFile:/secrets/oauth-consumer-key.txt}"
            password: "${readFile:/secrets/oauth-consumer-secret.txt}"

```

I have Jenkins running as Docker-Container on a Debian-Server and to test plugins etc. on my MacBook.

When I load CasC on my MacBook everything is fine, but on server the o-auth password is loaded falsly. When I enter password on credentials page, everything is fine.

I kopied my secret files from Mac to server, but still have wrong credentials.  
I checked file permissions etc. and alls seems ok.  
Finalle I changed  
`password: "${readFile:/secrets/oauth-consumer-secret.txt}"`by direct password temporary `password: "some-secret-password"` but still die not work.

Can anyone try to help?

---

<div class="post-metadata">

**Author:** ![oj4wipro](https://avatars.discourse-cdn.com/v4/letter/o/eb8c5e/32.png) [@oj4wipro](https://community.jenkins.io/u/oj4wipro)\
**Post date:** [December 16, 2024, 12:02pm UTC](https://community.jenkins.io/t/jenkins-casc-credentials-issue/24565/2 "2024-12-16T12:02:11Z")

</div>

Seems to be this issue: [Helpers like `readFile` in JCasC YAML Fails to Load Password from File · Issue #2522 · jenkinsci/configuration-as-code-plugin · GitHub](https://github.com/jenkinsci/configuration-as-code-plugin/issues/2522)
