PropelAuth is a Python library for managing authentication and authorization in B2B/multi-tenant applications. It provides features like user login, signup, organization management, roles, permissions, and API key authentication. The library simplifies backend authorization with hosted UIs and a developer-friendly SDK. It maintains an active release cadence with frequent updates for new features and improvements. Current version is 4.3.2.
pip install propelauth-pyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the PropelAuth client and validate an access token. It uses environment variables for secure configuration. Upon successful validation, it prints user and organization details. It also includes commented-out code for an example backend API call (e.g., creating a magic link).
Access attributes directly (e.g., `user.user_id`) instead of treating the object as a dictionary for unpacking. Dictionary-style key lookup (`user["user_id"]`) still works, but direct attribute access is preferred.
Consider using the framework-specific PropelAuth library if available for your chosen web framework to leverage native integration patterns.
To disable exception logging, pass `log_exceptions=False` during initialization (e.g., `init_base_auth(..., log_exceptions=False)`) or configure it globally using `propelauth_py.configure_logging(log_exceptions=False)`.
Ensure you import and use `init_base_async_auth` for asynchronous contexts. This often requires an `httpx.AsyncClient()` if a custom client is needed.
Access user attributes directly (e.g., `user.user_id`, `user.email`). If you need a dictionary representation, you might need to convert it explicitly if the library doesn't provide a `.to_dict()` method.
Ensure the `Authorization` header is present and in the format `Bearer {TOKEN}`. Verify that your `AUTH_URL` and `API_KEY` are correct and match your PropelAuth project settings. Check if the token itself is valid and not expired.Run `pip install propelauth-py` to install the library. For serverless applications, ensure `propelauth-py` is listed in your `requirements.txt` file (or equivalent) so it gets bundled with your deployment.
No dependency data recorded yet.