Authentication

To authenticate, pass credentials to Client.log_in.

Username and password — the most common method:

from flowbio.v2 import Client, UsernamePasswordCredentials

client = Client()
client.log_in(UsernamePasswordCredentials(
    username="alice", password="s3cret",
))

Existing token — useful when you already have a token:

from flowbio.v2 import Client
from flowbio.v2.auth import TokenCredentials

client = Client()
client.log_in(TokenCredentials(token="your.jwt.token"))
class flowbio.v2.auth.Credentials

Abstract base class for authentication credentials.

Subclasses implement authenticate() to perform their specific authentication flow against the Flow API.

class flowbio.v2.auth.TokenCredentials(token)

Authenticates using an existing JWT token.

Sets the token directly on the transport without making any HTTP requests. Useful when a token has already been obtained through another mechanism (e.g. the v1 client).

Parameters:

token (str) – The JWT access token.

Example:

from flowbio.v2 import Client
from flowbio.v2.auth import TokenCredentials

client = Client()
client.log_in(TokenCredentials(token="your.jwt.token"))
class flowbio.v2.auth.UsernamePasswordCredentials(username, password)

Authenticates to the Flow API with a username and password.

Parameters:
  • username (str) – The user’s username.

  • password (str) – The user’s password.