Adding a GitHub API authtoken - KSP-CKAN/CKAN GitHub Wiki

Adding a GitHub authtoken (also known as Personal Access Token)

CKAN v 1.24.0 adds the ability to store and use authorisation tokens for accessing download sites. This is especially useful for GitHub, which has a very low request limit for unauthenticated users.

Generate a GitHub token

  • If you do not already have one, create a GitHub user account
  • Go to the "Personal access tokens" page in your account settings.
    • Direct link: https://github.com/settings/tokens
    • Alternatively:
      • Navigate to your GitHub Settings page (the rightmost drop-down on the GitHub top bar will get you to Settings)
      • Go to Developer Settings (near the bottom of the page)
      • Select "Personal access tokens" on the left
  • Click on "Generate new token"
  • Enter a Token description, e.g. "CKAN Client"
  • In the scopes area, select only public_repo
  • Click on "Generate token"
  • You will now see a long hexadecimal string at the top of a list of any other authorisation tokens you may have generated for other purposes.
  • Click on the little "copy token" clipboard icon to put the token into your clipboard.
  • Launch the CKAN GUI, choosing any KSP instance you like. The tokens are not specific to a KSP instance.
  • Click on Settings -> CKAN Settings
  • In the "Authentication Tokens" box, click New
  • Enter api.github.com in the Host box
  • Paste the token from the GitHub "Personal access tokens" page.
  • Click "Accept"

You will now use your own authentication token when downloading any mods where the metadata is configured for API download, which will prevent you being speed-limited as an unauthenticated user.

For more ways to add an authentication token to your CKAN client, see this pull request