Skip to content

Commit

Permalink
expire rather than rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
abbycross committed Nov 27, 2024
1 parent 57dbf4f commit a055c25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/guides/functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"id": "80441467-1d9a-4107-8570-22afa6e369f7",
"metadata": {},
"source": [
"3. <span id=\"functions-untrusted\"></span>**Avoid executing code on an untrusted machine or an external cloud Python environment to minimize security risks.** If you must use an untrusted environment (on, for example, a public computer), change your API token after each use by rotating it on the [IBM Quantum Platform dashboard](https://quantum.ibm.com/) (click the refresh button in the API token field). To initialize the service in this situation, expand the following section to view code you can use:\n",
"3. <span id=\"functions-untrusted\"></span>**Avoid executing code on an untrusted machine or an external cloud Python environment to minimize security risks.** If you must use an untrusted environment (on, for example, a public computer), change your API token after each use by expiring it on the [IBM Quantum Platform dashboard](https://quantum.ibm.com/) (click the refresh button in the API token field) to reduce risk. To initialize the service in this situation, expand the following section to view code you can use:\n",
"\n",
" <details>\n",
" <summary>Initialize the service in an untrusted environment</summary>\n",
Expand All @@ -116,7 +116,7 @@
" from qiskit-ibm-catalog import QiskitFunctionsCatalog\n",
"\n",
" # After using the following code, go to your dashboard (https://quantum.ibm.com/)\n",
" # and rotate your API token (click the refresh button in the API token field) \n",
" # and expire your API token (click the refresh button in the API token field) \n",
" catalog = QiskitFunctionsCatalog(token=\"<MY_IBM_QUANTUM_TOKEN>\")\n",
" ```\n",
" </details>"
Expand Down
5 changes: 3 additions & 2 deletions docs/guides/setup-channel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ Available plans:
* If you are saving multiple accounts per channel, consider using the `name` parameter to differentiate them.
* Credentials are saved to `$HOME/.qiskit/qiskit-ibm.json`. Do not manually edit this file.

1. <span id="untrusted-machine"></span>**Avoid executing code on an untrusted machine or an external cloud Python environment to minimize security risks.** If you must use an untrusted environment (on, for example, a public computer), change your API token after each use by rotating it on the [IBM Quantum Platform dashboard](https://quantum.ibm.com/) (click the refresh button in the API token field). To initialize the service in this situation, you can use code like the following:
1. <span id="untrusted-machine"></span>**Avoid executing code on an untrusted machine or an external cloud Python environment to minimize security risks.** If you must use an untrusted environment (on, for example, a public computer), change your API token after each use by expiring it on the [IBM Quantum Platform dashboard](https://quantum.ibm.com/) (click the refresh button in the API token field) to reduce risk. To initialize the service in this situation, you can use code like the following:

```python
from qiskit_ibm_runtime import QiskitRuntimeService

# Refresh your API token on the dashboard after using the code as follows:
# After using the following code, go to your dashboard (https://quantum.ibm.com/)
# and expire your API token (click the refresh button in the API token field)
service = QiskitRuntimeService(channel="ibm_quantum", token="<MY_IBM_QUANTUM_TOKEN>")
```

Expand Down

0 comments on commit a055c25

Please sign in to comment.