QCS Credentials
Last updated
Last updated
Credentials are needed to authenticate all requests to the QCS API. By default, your credentials and QCS settings are stored in the ~/.qcs
directory and managed by QCS software.
The process is different for the first time you get your credentials (Initialization) vs. updating them when they expire (Refresh). There are two different expirations to be aware of:
Every hour, for security reasons, your Access Token expires. It is automatically and silently refreshed by all QCS software when needed (to include our SDKs, CLI, and pyquil
). You don't have to do anything special to refresh it; stored alongside your Access Token is a Refresh Token which is used for this purpose.
After 90 days (or in other uncommon situations), your Refresh Token itself may expire. When this happens, you must obtain a new token following the steps below in Initialization.
If you're seeing errors related to your credentials, it's often a good idea to re-initialize your credentials as described below.
The best way to configure or refresh your credentials depend on your environment:
If you are using QCS JupyterHub, your credentials are automatically configured for you when you start your server. The easiest way to refresh them is to restart your server using the instructions.
If you are in an environment with the QCS CLI and a web browser, then you can use it to trigger a credentials refresh by using it to make a request to the QCS API. For example, using the command:
After running this command, you may be prompted to login to QCS using your browser. Do so, and the CLI will finish configuring your credentials for you. If there is no prompt and the command shows you your current account information, then your credentials are already up to date.
See Using the QCS CLI for details on setting up and using the QCS CLI.
You can acquire your credentials from the tokens page on QCS. Follow the instructions on the page to download and install your credentials. You can then copy these files to wherever you use them.