Skip to content

[Feature]: Add configurable per-user identifier limits #121

Description

@mckaragoz

Description

UltimateAuth currently supports multiple identifiers per user, but there is no configurable limit on the total number of identifiers a user can add.

To prevent abuse and unnecessary data growth, introduce configurable limits at the Users domain level.

Proposed Design

options.Identifiers.Behavior.MaxIdentifiersPerUser = 10;

options.Identifiers.Behavior.MaxIdentifiersPerType = new()
{
    [UserIdentifierType.Username] = 2,
    [UserIdentifierType.Email] = 5,
    [UserIdentifierType.Phone] = 3
};
  • Default total limit: 10 active identifiers per user.
  • Per-type limits are optional. When not configured, only the total limit applies.
  • Primary and non-primary identifiers count toward the same limits.
  • Soft-deleted identifiers do not count toward active limits.
  • Limits apply to both self-service and admin operations.
  • Existing identifier behavior options must remain compatible.
  • Exceeding a limit returns a clear validation error.
  • Concurrent additions must not allow limits to be exceeded.

Scope

Implement enforcement in the Users application layer, with regression tests for InMemory and EF Core persistence.

Identity Lab can later display the configured limits and remaining capacity in its identifier management UI.

Activity

  1. added this to the v0.2.0 milestone on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions