Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could we have USERNAME_CLAIM non-mandatory? #263

Open
cusco opened this issue Nov 17, 2022 · 6 comments
Open

could we have USERNAME_CLAIM non-mandatory? #263

cusco opened this issue Nov 17, 2022 · 6 comments

Comments

@cusco
Copy link

cusco commented Nov 17, 2022

Hello, thanks for the great work on this plugin.

I'm attempting to integrate with AzureAD, and our django backend has some custom pattern for usernames, that won't match anything in Azure.
We'd like to use the email field to match Azure's UPN only, being that email is unique in our backend.

Do you think this makes sense and should be changed in the plugin?

Like a mandatory setting like UPN_CLAIM_MAPPING = 'email_field'

Fund with Polar
@tim-schilling
Copy link
Member

tim-schilling commented Nov 17, 2022

Am I understanding you correctly that you'd like to key authentication based on the email rather than the username because the username in Django can't match what Azure would pass back?

If that's the case, would this new configuration only be usable if the setting to create users is disabled because a username can't be determined?

@cusco
Copy link
Author

cusco commented Nov 17, 2022 via email

@tim-schilling
Copy link
Member

I think I'd need to be convinced that this is an issue for more folks before agreeing that it's something that should be supported out of the box. Let's see what other maintainers think.

I'm happy to help with PRs that refactor the application to make it easier for you to implement this on your end. It's clearly a real possibility, but I think I'd prefer that you maintain it in your own project (with the information and understanding I have currently).

@JonasKs
Copy link
Member

JonasKs commented Nov 17, 2022

Hmm, I'm not entirely sure I understand, so please clarify:

  • you already have the users
  • you don't want creation of new users
  • you want the user to log in through azure, but not really do anything with it, except match it towards an already existing user

?

@cusco
Copy link
Author

cusco commented Nov 17, 2022 via email

@cusco
Copy link
Author

cusco commented Nov 18, 2022

I think I'd need to be convinced that this is an issue for more folks before agreeing that it's something that should be supported out of the box. Let's see what other maintainers think.

I'm happy to help with PRs that refactor the application to make it easier for you to implement this on your end. It's clearly a real possibility, but I think I'd prefer that you maintain it in your own project (with the information and understanding I have currently).

Thank you for your support. Tho this might not be needed by anyone else, I did create a PR with changes suiting my needs:
#264

I guess that if it were to be approved, docs would need to reflect the new setting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants