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

🐛 User attributes mapping documentation bug #32

Closed mitchdawson1982 closed 4 months ago

mitchdawson1982 commented 4 months ago

In the user attributes mapping section of the readme, the User model example specifies an attribute full_name however the user mapping function example refers to first_name. I can raise a PR.

class User(AbstractUser):
    full_name = models.CharField()

_You want to populate the fullname field using the givenName and surname AAD user attributes i.e not a 1-to-1 mapping. You also want to mark the user as staff.

# main/utils.py

def user_mapping_fn(**attributes):
    return {
        "first_name": attributes["givenName"] + attributes["surname"],
        "is_staff": True,
    }
regoawt commented 4 months ago

Oh dear, thanks for noticing!

Yes feel free to raise a PR.

Cheers

mitchdawson1982 commented 4 months ago

Oh dear, thanks for noticing!

Yes feel free to raise a PR.

Cheers

Do I need to be added as a collaborator?

regoawt commented 4 months ago

No you'd need to fork the repo and open a PR that way. But I've fixed it now anyway.