Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

[ZAuth/OAuth/Users] User account policies  #4475

Description

@Kaik

This title might be misleading, if you have a better idea to describe this issue please feel free to update the title.

I'm writing it because on slack it might get diluted and disappear and it is important IMHO.
So looking at users table schema we can see what user account policies can be created with this schema.

By user accounts polices I mean a set of rules that are controlling the way accounts are created and how those accounts are treated by the system. The reason I'm writing this is that since PostNuke it has changed. We used to have unique username, then unique email, then duplicate emails and now emails are unique only for authMethod...
All below policies are important because some people might need these, policies in most cases are not compatible with each other so policy change on a system, with users already registered might cause issues.

The basic idea behind policy is which field in users table we will use as unique, and how we proceed with other fields.

  1. uid - it is unique by default so the simples policy would be to type uid and password - some systems might need this simple policy. Hard to think about an example but all systems where you type your number and password are example of this policy.

  2. uname - this is classical login password policy user names are unique.

  3. email - policy where uname is not considered to be important in terms of user identification in the system and email address is. In real life this is relatively common policy as an email address is in most cases what we use to identify one user.

  4. additional indirectly unique policies - for example current core3 policy that makes emails unique only in conjunction with authentication method. see below*
    ...

Above are basic policies that can be develop upon. So for example uid or uname policy can have duplicate emails allowed and this can indicate that those accounts belong to the same person (connected via email). Easy account switch can be implemented so single person can act as different users without the need to log out and log in again.

Uname and email can be both required to be unique this way you can use any of those informations to log in to the right account.

*Current option in core3 that restricts email to be unique per authorisation method is quite unusual situation, but fully legitimate as a policy - just unusual IMHO.

The problem I have with this is that I don't think generally website owners want that, and it is actually against commonly expected behaviour. It might be needed in special cases tho. So I don't have a problem with the policy itself but in that it is implemented before more common basic ones.

Most common situation (I think) is that when person uses his email address to identify himself in the system, method that he is using to provide this email address is irrelevant and should point to the same account. So when I use methods -> email or either or facebook or google (assuming same email address) to register an account it should be one account and it should be accessible via any of those methods. That of course in case I use unique email policy. Same email policy also indicates that in Table: zauth_authentication_mapping all methods with the same email are pointing to the same account.

The matter is complicated because many different policies can be created and whole system may react to them differently.
For example my current setup is allowing some users to have multiple accounts with the same email, but that can be created only by admin everybody else will have to use unique uname unique email, and all auth methods will point to one account.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions