Just as a case study, Shibboleth does this by having unscoped and
scoped usernames. The scoped username should be globally unique and
takes the form of "u...@school1.edu". Unscopped is not globally
unique, but unique for a particular scope (ie: "user").

It's temping to say "ahh... email address!" But in Shibboleth
terminology that would be a mistake. A single user (u...@school1.edu)
could have multiple email addresses (u...@school1.edu,
u...@dept.school1.edu, user-...@school.edu, etc). The scoped user
identifies the user independently of their emails, even though the
value might be the same.

Generally the scope part comes from the ID provider (the thing doing
the authentication and providing user attributes) and not the mail
system. So the ID provider could be an AD domain, for instance. As
long as it's unique.

On Mon, Jan 19, 2015 at 2:54 PM, Erik Cederstrand
<erik+li...@cederstrand.dk> wrote:
> Hello
>
> I'm creating a Django frontend for a legacy school system. The legacy system 
> has users, but usernames are only unique together with a school:
>
> class LegacyUser(models.Model):
>    school = models.ForeignKey(School)
>    username = models.CharField(max_length=40)
>
>    class Meta:
>        unique_together = ['school', 'username']
>
>
> I need to authenticate users using their school name, username and password, 
> so I can serve them data connected to the LegacyUser. The legacy system 
> provides an authentication service that I want to use to verify the password.
>
> The Django authentication model seems to revolve around the username being 
> unique, so I can't just inherit the User model, login forms etc. How do I get 
> the School shoe-horned into the Django auth framework, and where do I call 
> the external authentication service? Some ideas how to best accomplish this 
> would be great!
>
>
> Thanks,
> Erik
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/26BA41BB-1771-4C5C-9980-A2C49F30280C%40cederstrand.dk.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD4ANxVXgiUeTYkX1xzMoZfsUMFmNmx8WqiqpDozWvWt7zKjrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to