Weird-Sheep-Labs / django-azure-auth

A simple Django app for user authentication with Azure Active Directory/Entra ID.
MIT License
17 stars 10 forks source link

Groups management section of README #40

Closed danielNemeth19 closed 1 week ago

danielNemeth19 commented 2 weeks ago

I've been using the package and had some troubles with the groups management section.

I think for it to properly work, one has to make sure during the group claim configuration that the user's groups are emitted as roles claims. Seems to me Azure emit this information under a groups key by default, however the AuthHandler's authenticate method expects a roles key in the id_token_claims for handling permissions (i.e. adding user to the mapped Django group based on group membership).

I've prepared a commit for this clarification and opened a PR, hope you don't mind! Please let me know what do you think :)

regoawt commented 1 week ago

Looks like you're right, thank you!