GitHubAppCredential token refresh no longer working

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    Since the introduction of https://github.com/jenkinsci/credentials-plugin/pull/327 the `GitHubAppCredential` is replaced by a standard `UsernamePasswordCredential` and so the token refresh is no longer working.

    The writeReplace() is no longer called if the credential is snapshotted before use.  this means that the token sent to the agent is static and will not be replaced.

    unclear how best to reproduce the error - but it is obvious via code inspection that the GitHubAppCredential is replaced.

    at org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials.createJwtProvider(GitHubAppCredentials.java:157)
    at org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials.access$000(GitHubAppCredentials.java:54)
    at org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials$TokenProvider.<init>(GitHubAppCredentials.java:165)
    at org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials$TokenProvider$1.<init>(GitHubAppCredentials.java:179)
    at org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials$TokenProvider.createTokenRefreshGitHub(GitHubAppCredentials.java:178)
    at org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials.generateAppInstallationToken(GitHubAppCredentials.java:216)
    at org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials.getToken(GitHubAppCredentials.java:298)
    at org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials.getPassword(GitHubAppCredentials.java:327)
    at com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsSnapshotTaker.snapshot(UsernamePasswordCredentialsSnapshotTaker.java:28)
    at com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsSnapshotTaker.snapshot(UsernamePasswordCredentialsSnapshotTaker.java:9)
    at com.cloudbees.plugins.credentials.CredentialsProvider.snapshot(CredentialsProvider.java:821)

          Assignee:
          James Nord
          Reporter:
          James Nord
          Archiver:
          Jenkins Service Account

            Created:
            Updated:
            Resolved:
            Archived: