snok / django-auth-adfs

A Django authentication backend for Microsoft ADFS and AzureAD
http://django-auth-adfs.readthedocs.io/
BSD 2-Clause "Simplified" License
270 stars 100 forks source link

Update docs to show an audience list can be provided #229

Closed nnadams closed 2 years ago

nnadams commented 2 years ago

The underlying Python JWT library supports validating tokens against a list of audiences. Without any code changes, I was able to just pass in a list to the AUDIENCE setting, after looking through the JWT library code. It would be nice if these docs showed this is a possible configuration:

AUTH_ADFS = {
    'AUDIENCE': ['xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx', 'api://xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx']
}
JonasKs commented 2 years ago

Thank you! I feel like this was added in a recent version(?), so we should probably write a note about that.

I'll see if I can find it in the patch notes which version it is tomorrow.

nnadams commented 2 years ago

Looks like multiple audiences might be from the pull request jpadilla/pyjwt#306, released in pyjwt version 1.6.0. I think their multiple issuers pull request is still open.

Thanks for this project by the way!

JonasKs commented 2 years ago

Ah, perfect. I’ll merge this now. Thank you so much 😊