You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Account credentials are saved in plain text, so only do so if you are using a trusted device.
This issue has two parts:
We should update the setup instructions
Places where we state the above warning, we should add a link for users to learn how securely manage their token
Update places where <YOUR_IQP_API_TOKEN> is stated to os.getenv("IQP_API_TOKEN")
Content
To store sensitive information like account credentials more securely, it’s a good practice to use environment variables instead of saving them in plain text. Here’s how you can modify your code to load the API token from an environment variable.
Set the environment variable:
Set the IQP_API_TOKEN environment variable in your system. You can do this by adding the following line to your shell profile (e.g., .bashrc, .zshrc) or by setting it directly in your terminal:
export IQP_API_TOKEN="<YOUR_IQP_API_TOKEN>"
Modify the Code to Retrieve the Token from the Environment Variable
Update your code to retrieve the token from the environment variable instead of saving it directly:
importosfromqiskit_ibm_catalogimportQiskitFunctionsCatalog# Gather the token from your environmentiqp_api_token=os.getenv("IQP_API_TOKEN")
QiskitFunctionsCatalog.save_account(token=iqp_api_token)
If this new content request is accepted, do you want to write the content?
I can help the team by providing enough information to write the material
The text was updated successfully, but these errors were encountered:
pandasa123
changed the title
Update guidance to securely store tokens
Update guidance to manage tokens in environment, rather than plaintext
Nov 7, 2024
URL, if applicable
Describe the new content you are requesting.
What needs to updates?
Currently, we state the following:
This issue has two parts:
<YOUR_IQP_API_TOKEN>
is stated toos.getenv("IQP_API_TOKEN")
Content
To store sensitive information like account credentials more securely, it’s a good practice to use environment variables instead of saving them in plain text. Here’s how you can modify your code to load the API token from an environment variable.
Set the
IQP_API_TOKEN
environment variable in your system. You can do this by adding the following line to your shell profile (e.g.,.bashrc
,.zshrc
) or by setting it directly in your terminal:Update your code to retrieve the token from the environment variable instead of saving it directly:
If this new content request is accepted, do you want to write the content?
I can help the team by providing enough information to write the material
The text was updated successfully, but these errors were encountered: