Skip to content

Releases: intility/fastapi-azure-auth

2.0.0 - `FastAPI` application is no longer passed to the `AzureAuthorizationCodeBearer`

18 Aug 14:11
db2d852
Compare
Choose a tag to compare

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:
@app.on_event('startup')
async def load_config() -> None:
    """
    Load config on startup.
    """
    await provider_config.load_config()
  1. If you've overwritten the default tenant_id, you can also add that to load_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

17 Aug 14:42
a8f108e
Compare
Choose a tag to compare

Features

  • Improve how key to validate token is chosen. It's now based on kid, instead of trying all keys ( #10 @JonasKs )

Other/Improvements

  • More test cases for validating tokens ( #10 @JonasKs )
  • Test case for refreshing of provider config ( #10 @JonasKs )
  • More comments describing patterns and choices in the code ( #10 @JonasKs )

1.1.0 - User attached to the request state

15 Aug 20:01
8122b19
Compare
Choose a tag to compare

Features

  • User attached to the request state ( #6 @JonasKs )

Improvements

1.0.0 - Release of FastAPI-Azure-auth

13 Aug 08:29
Compare
Choose a tag to compare

Features

  • Simple setup of Azure Authentication for FastAPI apps