Microsoft Identity Configuration
Password policies, lockout settings, user validation, and sign-in configuration
Password Configuration
Password configuration settings define the security requirements and validation rules for user passwords. These settings help ensure password strength and compliance with security policies.
Password Requirements:
AllowedPasswordRegex Pattern:
Pattern Explanation:
- •
\w- Word characters (letters, digits, underscore) - •
;.:|-!|$*()- Common special characters - •
@\\{}- Additional symbols (@ backslash, braces) - •
^...$- Must match entire string from start to end - •
+- One or more allowed characters
Security Recommendations:
- • Minimum length of 8-12 characters for better security
- • Enable all character type requirements for strong passwords
- • Consider unique character requirements to prevent simple patterns
- • Regular expressions should allow sufficient character variety
Lockout Configuration
Lockout settings protect against brute force attacks by temporarily disabling accounts after multiple failed login attempts. These settings balance security with user accessibility.
Lockout Settings:
Best Practices:
- • Use 3-5 failed attempts before lockout to balance security and usability
- • Set lockout duration between 5-15 minutes for most applications
- • Enable lockout for new users to prevent account enumeration attacks
- • Consider implementing progressive lockout times for repeated offenses
User Settings
User settings control username validation rules and email uniqueness requirements. These settings define how users can create and manage their account identifiers.
Username & Email Configuration:
AllowedUserNameRegex Pattern:
Pattern Explanation:
- •
[a-zA-Z0-9]- Must start with alphanumeric character - •
([._+][a-zA-Z0])- Allows dots, underscores, plus signs between characters - • Prevents usernames starting or ending with special characters
- • Ensures readable and valid username format
DefaultUserGroup
This setting allows you to select a default user group that will be automatically assigned to every new user created through the registration flow. The value is selected through a dropdown listing all available groups, excluding the Administrator group for security reasons.
When configured, the selected group is applied during account creation, ensuring that new users start with a consistent permission set aligned with your application's policies.
Behavior
- Displays a dropdown containing all groups except Admin.
- The selected group is automatically assigned to newly registered users.
- Existing users are not affected by changes to this setting.
- The value can be updated at any time without retroactive impact.
Username and Email Handling
IdentitySuite automatically manages the relationship between usernames and email addresses to provide optimal user experience while maintaining data integrity. This section explains how this system works and what administrators can expect to see in the database and user management interfaces.
How IdentitySuite Handles Username and Email:
UserName in the database.
This creates the initial username-email relationship.
Email field in the database while preserving the original
UserName. This maintains data consistency while allowing seamless authentication with the new email.
What You'll Observe in the System:
- • In the database,
UserNamecontains the original registration email - • The
Emailfield reflects the user's current email address - • Users can successfully login with their current email, even if it differs from UserName
- • Login interfaces display "Email" prompts, as this is what users should enter
Administrative Considerations:
Benefits of This Approach:
- • Users can update their email address without losing account access
- • Simplified login process - users only need to remember their email
- • Maintains data consistency for existing user relationships and audit trails
- • Follows modern web application patterns and user expectations
Sign-In Settings
Sign‑in settings define the verification requirements that users must satisfy before they are allowed to authenticate. These options control whether email and phone number confirmation are mandatory, ensuring that only identities with validated contact information can access the application.
Verification Requirements:
Security Considerations:
- • Email confirmation prevents fake account creation and ensures communication channels
- • Phone verification adds an extra security layer
Login Options
These options define how users can authenticate and access the platform, enabling or disabling specific login mechanisms such as social providers, passkeys, email- or phone‑based authenticators, and controlling whether registration is open or restricted. They allow administrators to tailor the identity experience to the security posture and UX requirements of the application.
Registration Control:
RequireConfirmedEmail is enabled,
grants immediate access after registration without waiting for email confirmation.
The session remains active while the user is using the application; once the session expires,
login is blocked until the email is confirmed.
RequireConfirmedPhoneNumber
to be enabled and a valid ISmsSender
implementation.
How Phone-based Authentication works
Prerequisites
RequireConfirmedPhoneNumbermust be enabled- An
ISmsSenderimplementation must be registered - The user must have a verified phone number
Authentication Flow
- The user signs in with their primary credential (e.g., password, external login, passkey)
- If SMS-based 2FA is enabled for the account, a one‑time code is generated
-
The code is sent via SMS using the registered
ISmsSenderimplementation - The user enters the received code to complete the second factor
- Upon success, a standard session token is issued
ISmsSender interface must be implemented
by the host application to integrate with the chosen SMS provider (e.g., Twilio, AWS SNS,
Infobip, custom gateway), and the implementation must be registered in the application's
dependency injection container.
RequireConfirmedPhoneNumber
is false.
Both options must be enabled together.
How SoftEmailVerification works
First Access
- User completes registration
- User is immediately signed in and redirected to the application
- The token includes the claim
email_confirmation_pending: true - A confirmation email is sent in the background
Subsequent Access
- While the user remains active, the session is transparently renewed
- Once the session expires, the next login is blocked until the email is confirmed
- After confirmation, the user logs in normally and
email_confirmation_pendingis no longer issued
email_confirmation_pending claim from the token
to differentiate the experience for unverified users — for example by showing a confirmation banner,
restricting sensitive operations, or limiting access to features that require a verified identity.
RequireConfirmedEmail is
false.
Both options must be enabled together.
Security Considerations:
- • Disable self-registration for internal applications or high-security environments
- • Consider the user experience impact of requiring multiple verification steps
- • Use
SoftEmailVerificationfor transactional flows where blocking registration increases abandonment risk
Store Settings
Store settings control data storage and privacy protection features for user information. These settings determine how sensitive data is handled and protected within the identity system.
Data Protection Settings:
Additional Considerations:
- • Enabling personal data protection may impact query performance
- • Requires proper data protection key management and rotation
- • Essential for GDPR compliance and privacy regulations
- • Backup and recovery procedures must account for encrypted data
CRITICAL: Database Recreation Required
Enabling or disabling ProtectPersonalData requires a complete database recreation.
There is no automatic migration path - existing data cannot be automatically
encrypted or decrypted when toggling this setting.
Plan accordingly: This setting must be decided before initial deployment. Changing it later will result in data loss unless you implement custom migration procedures.
Implementation Notes:
- • Personal data protection uses ASP.NET Core Data Protection APIs
- • Encryption keys should be properly managed and backed up
- • Consider performance implications for large user databases
- • Test backup and restore procedures with encrypted data