Authentication¶
A single login gives you access everywhere: DataQruiser, the qDrive Python package, and the sync agent all share one session. Sign in once — through the app or from Python — and you're authenticated for all three. The session is persistent, so you normally only log in once per machine.
One shared session¶
- Log in once. Signing in through either DataQruiser or qDrive authenticates both — you don't sign in separately for the app and for Python.
- Shared logout and refresh. Logging out of one logs out the other, and a token refresh by one process is picked up by the others.
- Persistent. The session survives restarts; you only log back in after logging out or when it expires.
Logging in from Python¶
First, check which institutions and login methods are available:
Then log in with the method that fits your setup:
Opens your browser for secure authentication through your institution's identity provider:
If an institution has multiple SSO providers, specify which one to use:
For an interactive prompt that securely hides your password:
from qdrive.authenticate import log_in_with_password_prompt
log_in_with_password_prompt("MyInstitution")
Not all institutions support password login — use print_login_methods() to check.
Useful on servers or in CI/CD pipelines where no browser is available. Generate a token in the DataQruiser app (see API tokens below), then:
Logging in from the DataQruiser app¶
You can also sign in directly in the DataQruiser app. Because the session is shared, that login also authenticates qDrive and the sync agent — no separate Python login needed.
Checking status and logging out¶
API tokens¶
The shared session is your interactive login — when it ends, the sync agent loses its credentials and stops uploading. An API token gives the agent its own long-lived credential so it keeps syncing independently. Reach for one when:
- The agent runs on another machine — a headless lab server has no browser to log in with and doesn't share your session.
- Your identity provider expires logins — if SSO signs you out on a schedule, a token keeps the agent uploading without you logging back in.
- You log out or hand over a shared machine — the sources you created keep syncing under your identity after you sign out.
Create and manage tokens in the DataQruiser app under Sync Settings → API Tokens — see Managing synchronization in DataQruiser for the UI steps. To use a token from Python (for example on a headless server):
from qdrive.authenticate import log_in_with_api_token
log_in_with_api_token("your_token@https://api.example.com")
Warning
An API token is a secret key. Don't store it in files or commit it to version control — prefer an environment variable. If a token is compromised, revoke it in the DataQruiser app.