Create a new GitHub user-to-server token

A user-to-server token is the OAuth feature of GitHub Apps. It is a token which permits a GitHub to act on behalf of a user, which means the token is restricted by both: the app's and the user's permissions and accesss. (learn more)

Step 1: GitHub App credentials

If you haven't yet, register a new app for your account or an organization in settings → Developer settings → GitHub Apps. Uncheck "Expire user authorization tokens" unless you want the token to expire after 8 hours. Deactivate webhooks and set the permissions you want the user-to-server token to inherit.

Enter the Client ID from your GitHub App

Generate a new client secret and enter it here.

Step 2: Install the app

You can install the app on all existing and future repositories, or on a selected set of repositories. The user-to-server token will be restricted to the repositories the app is installed on.

Step 3: Create the token