Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 1.55 KB

creating_an_access_token.md

File metadata and controls

22 lines (16 loc) · 1.55 KB

Creating an access token

Access tokens permit authenticated access to the Sourcegraph API. This is required for the src command line interface to Sourcegraph to operate, and also allows other tools that integrate with Sourcegraph to issue requests on your behalf.

Creating an access token is done through your user settings. This video shows the steps, which are then described below:

  1. From any Sourcegraph page, click on your avatar at the top right of the page.

  2. Select Settings from the dropdown menu.

  3. Select Access tokens from the sidebar menu.

  4. Click Generate new token.

  5. Enter a description, such as src.

    NOTE: The user:all scope that is selected by default is sufficient for all normal src usage, and most uses of the GraphQL API. If you're an admin, you should only enable site-admin:sudo if you intend to impersonate other users.

  6. Click Generate token.

  7. Sourcegraph will now display your access token. You must copy it from this screen: once this page is closed, you cannot access the token again and can only revoke it and issue a new one.

You can then set the SRC_ACCESS_TOKEN environment variable to the token to use it with src.