Fastapi-azure-auth

Latest version: v5.1.1

Safety actively analyzes 723166 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 6

3.0.2

Not secure
**Fixes**

* Loosen FastAPI version requirement, allowing installation of this module on FastAPI 0.70.0+ ( bmoore 28 )
* Add `Python3.10` and `FastAPI==0.70.0` to pipeline matrix ( jonasks 28 )

3.0.1

Not secure
**Fixes**

* Multi-tenant schema documentation ( 20 sondrelg )
* Multiple errors in the documentation ( 22 daniwk )
* Update `cryptography` requirement to `^35.0.0` and fix imports ( 26 bmoore )

3.0.0

Not secure
This release contains breaking changes for how to setup your application, but also a bunch of new features.

The new [documentation](https://intility.github.io/fastapi-azure-auth/) contains a full tutorial on how to configure Azure AD and FastAPI for both single- and multi-tenant applications.


Features
* Add `v2` token support (and default) for single-tenant applications.
* Full multi-tenant support
* Option to provide a callable which returns valid `iss`(issuers), for those who has multi-tenant applications, but only for specific tenants

Other
* User object is reworked, now also contain `access_token` for easier Azure Graph implementation
* Add support for denying requests with wrong scopes, when `Securiy()` is used (an alternativ to `Depends()`)
* Moved `InvalidAuth` to `exceptions.py`
* Documentation for everything from role checks, guest users, locking down tenants etc.
* No longer inheriting `OAuth2AuthorizationCodeBearer`, solving mypy errors.
* Rename `provider_config.py` to `openid_config.py` and `ProviderConfig()` to `OpenIdConfig()`
* Removal of pre-instance of `provider_config` due to OpenAPI authorization URL issues. This is now instanced on `SingleTenantAzureAuthorizationCodeBearer` or `MultiTenantAzureAuthorizationCodeBearer`.


Features implemented in 16 ( JonasKs )

3.0.0rc1

Not secure
Release candidate for `3.0.0`.

Release notes will be written for the actual release.

2.0.1

Not secure
**Fixes**

* Make `upn` an optional field in the `User` model, to support `Client Credential Flow` ( 12 JonasKs )

2.0.0

Not secure
**Breaking changes**
* Removal of `app` parameter from `AzureAuthorizationCodeBearer`
* `AzureAuthorizationCodeBearer` now returns a `User` object instead of a dictionary with claims

**Other**
* Documentation on how to create your own dependencies for checking `roles`, `scp` or similar
* Add docs on how to load provider config on startup, it is no longer auto-loaded by `AzureAuthorizationCodeBearer`

Related MR: 11 by JonasKs

--------------


**Upgrade guide from v1 to v2**
I strongly suggest reading the entire `README.md` again, as it's a bit more verbose compared to before.
With that said, these are the steps you have to do in order to bump from v1 to v2:

1. Remove `app=app` from your `AzureAuthorizationCodeBearer()` in `main.py`.
2. If you have a `dependencies.py` file or similar, move the `azure_scheme = AzureAuthorizationCodeBearer( ... )` to that file.
2.1. In your `main.py`, import `azure_scheme` from `dependencies.py`
3. In your `main.py` file, load the provider config on startup:
py
app.on_event('startup')
async def load_config() -> None:
"""
Load config on startup.
"""
await provider_config.load_config()

4. If you've overwritten the default `tenant_id`, you can also add that to `load_config()`
diff
app.on_event('startup')
async def load_config() -> None:
"""
Load config on startup.
"""
+ provider_config.tenant_id = 'my-tenant-id'
await provider_config.load_config()

Page 5 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.