Authentication
Authenticate
Authenticate the Fused Python SDK in a Python Notebook.
Make sure to have the fused
package installed.
pip install "fused[all]"
To use Fused you need to authenticate. The following will store a credentials file in ~/.fused/credentials
:
- Notebook
- Python Script
In a notebook cell run:
from fused.api import NotebookCredentials
credentials = NotebookCredentials()
Follow the URL in your browser to authenticate.
Run the following:
from fused.api import NotebookCredentials
credentials = NotebookCredentials()
print(credentials.url)
And follow the URL in your browser to authenticate.
When running code from a Python environment without browser access, you may copy the ~/.fused/credentials
file to the same location in the target system.
Log out
Log out the current user. This deletes the credentials saved to disk and resets the global Fused API.
import fused
fused.api.logout()
Get Bearer (Access) token
Get the account's Bearer (sometimes referred to as Access) token.
import fused
fused.api.access_token()
This can be helpful when calling UDFs via HTTP requests outside of the Fused Python SDK and Workbench to authenticate with the Fused API.
Do not share your Bearer token with anyone. These allow to impersonate your account and should be treated as such.