Releases: intility/fastapi-azure-auth
Releases · intility/fastapi-azure-auth
2.0.0 - `FastAPI` application is no longer passed to the `AzureAuthorizationCodeBearer`
Breaking changes
- Removal of
app
parameter fromAzureAuthorizationCodeBearer
AzureAuthorizationCodeBearer
now returns aUser
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
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:
- Remove
app=app
from yourAzureAuthorizationCodeBearer()
inmain.py
. - If you have a
dependencies.py
file or similar, move theazure_scheme = AzureAuthorizationCodeBearer( ... )
to that file.
2.1. In yourmain.py
, importazure_scheme
fromdependencies.py
- In your
main.py
file, load the provider config on startup:
@app.on_event('startup')
async def load_config() -> None:
"""
Load config on startup.
"""
await provider_config.load_config()
- If you've overwritten the default
tenant_id
, you can also add that toload_config()
@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()
1.1.1 - Signature loop improvements
1.1.0 - User attached to the request state
1.0.0 - Release of FastAPI-Azure-auth
Features
- Simple setup of Azure Authentication for FastAPI apps