How to switch config server Github access from password to personal access token
search cancel

How to switch config server Github access from password to personal access token

book

Article ID: 297202

calendar_today

Updated On:

Products

Support Only for Spring

Issue/Introduction

If you need to change authentication on your config servers from username / password to username / personal-access-token, how can you do this without recreating the config servers?

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

Environment

Product Version: Other

Resolution

cf update-service command will update authentication from password to user access token. Pass the token via the password field, in place of the password.

Here is a sample JSON file (parameters.json) to pass in the parameters:
 
{ "git":
    { "uri": "https://github.com/github-account/app-config",
      "label": "master",
      "username": "enterprise-username",
      "password": "user-access-token-string"
    }
}

Then you can pass use this command, referencing the JSON file:

cf update-service <config-server-name> -c parameters.json


Instead of using a file, you can pass the JSON on the command line, like so:

cf update-service <config-server-name> -c '{"git": {"uri": "https://github.com/github-account/app-config", "label": "master", "username": "enterprise-username", "password": "user-access-token-string" } }'