fal.auth package

Submodules

fal.auth.auth0 module

fal.auth.auth0.build_jwk_client()
fal.auth.auth0.get_user_info(bearer_token)
Return type:

dict

fal.auth.auth0.login(console, connection=None, *, no_browser=False)

Runs the device authorization flow and stores the user object in memory.

Return type:

dict

Flow:
  1. Request device code from Auth0

  2. Open browser to fal.ai/login/cli (handles verification + auth with connection)

  3. Poll for token

fal.auth.auth0.logout_url(return_url)
fal.auth.auth0.refresh(token)
Return type:

dict

fal.auth.auth0.revoke(token, console, *, no_browser=False)
fal.auth.auth0.validate_id_token(token)

id_token is intended for the client (this sdk) only. Never send one to another service.

fal.auth.auth0.verify_access_token_expiration(token)

fal.auth.local module

fal.auth.local.delete_token()
Return type:

None

fal.auth.local.load_preference(key)
Return type:

str | None

fal.auth.local.load_token()
Return type:

tuple[str | None, str | None]

fal.auth.local.lock_token()

Lock the access to the token file to avoid race conditions when running multiple scripts at the same time.

fal.auth.local.save_preference(key, value)
Return type:

None

fal.auth.local.save_token(refresh_token, access_token=None)
Return type:

None

Module contents

class fal.auth.GoogleColabState

Bases: object

class fal.auth.UserAccess(_access_token=None, _user_info=None, _exc=None, _accounts=None)

Bases: object

property access_token: str
property accounts: list[dict]
property bearer_token: str
get_account(team)
Return type:

dict

property info: dict
fal.auth.current_user_info(headers)
Return type:

dict

fal.auth.get_colab_token()
Return type:

Optional[str]

fal.auth.is_google_colab()
Return type:

bool

fal.auth.key_credentials(profile=None)
Return type:

tuple[str, str] | None

fal.auth.login(console, connection=None, *, no_browser=False)
fal.auth.logout(console, *, no_browser=False)