Authentication Overview
The Tournament Management App uses ASP.NET Core Identity for authentication and authorization. This provides:- Secure user registration and login
- Password-based authentication
- Email confirmation
- Account lockout protection
- Future support for external authentication providers
User Access Levels
The application has two main access levels:Public (Unauthenticated) Users
Can:- View teams, players, and matches
- Use search and filter features
- Access detail pages for all entities
- Browse all public information
- Create new teams, players, or matches
- Edit existing records
- Delete any entities
Authenticated Users
Can:- Everything public users can do, plus:
- Create new teams, players, and matches
- Edit existing records
- Delete entities (subject to business rules)
- Access all management features
Currently, the application uses a simple authenticated/unauthenticated model. All authenticated users have the same permissions. Role-based access control (admin, manager, viewer) can be added in future versions.
Creating an Account
Fill in registration details
Enter the required information:
- Email: Your email address (used as username)
- Password: Choose a secure password
- Confirm Password: Re-enter your password
Password Requirements
For security, passwords must meet the following criteria:- Minimum length: 6 characters
- Require digit: At least one number (0-9)
- Require lowercase: At least one lowercase letter (a-z)
- Require uppercase: At least one uppercase letter (A-Z)
- Require non-alphanumeric: At least one special character (!@#$%^&*, etc.)
- Unique characters: At least 1 unique character
Logging In
Enter credentials
Provide your:
- Email: Your registered email address
- Password: Your account password
Login Options
From the login page, you can also:- ¿Olvidó su contraseña? (Forgot password): Reset your password
- Registrarse como usuario nuevo (Register as new user): Create an account
- Reenviar correo de confirmación (Resend confirmation email): Get a new confirmation link
Account Security Features
Account Lockout
To prevent brute-force attacks, the system includes account lockout:- Maximum failed attempts: 5 failed login attempts
- Lockout duration: 5 minutes
- Applies to: All users, including new accounts
Email Confirmation
Email confirmation is required for security:- Confirms you own the email address
- Prevents automated account creation
- Required before you can log in
- Confirmation links can be resent if needed
Didn't receive confirmation email?
Didn't receive confirmation email?
If you didn’t receive the confirmation email:
- Check your spam/junk folder
- Verify you entered the correct email address
- Click “Reenviar correo de confirmación” on the login page
- Wait a few minutes and check again
- Contact support if issues persist
Protected Pages and Features
The following pages and features require authentication:Team Management
- Creating teams:
/Equipos/Create - Editing teams:
/Equipos/Edit - Deleting teams: Delete button on
/Equipos/Index
Player Management
- Creating players:
/Jugadores/Create - Editing players:
/Jugadores/Edit - Deleting players: Delete button on
/Jugadores/Index
Match Management
- Creating matches:
/Partidos/Create - Editing matches:
/Partidos/Edit - Deleting matches: Delete button on
/Partidos/Index
Other Protected Areas
- Creating municipalities:
/Municipios/Create - Creating positions:
/Posiciones/Create - Creating technical directors:
/DTs/Create - All edit and delete operations
Protected pages are decorated with the
[Authorize] attribute in the code. Attempting to access these without logging in will redirect you to the login page.UI Changes Based on Authentication
The user interface adapts based on your login status:When Not Logged In
- Create buttons are hidden
- Edit buttons appear disabled (outlined)
- Delete buttons appear disabled (outlined)
- You can only view and browse data
When Logged In
- Create buttons are visible and active
- Edit buttons are enabled and clickable
- Delete buttons are enabled (subject to business rules)
- Full CRUD (Create, Read, Update, Delete) operations available
Logging Out
To log out of your account:- Click Cerrar sesión (Logout) in the navigation menu
- Confirm the logout action
- You’ll be redirected to the home page
Future Authentication Features
The application is prepared for future authentication enhancements:External Authentication Providers (Planned)
The codebase includes commented-out configuration for:- Google authentication
- Facebook authentication
- Microsoft account authentication
- Obtaining API credentials from the providers
- Adding credentials to configuration
- Uncommenting the code in
Program.cs
External authentication code preview
External authentication code preview
Troubleshooting
Cannot access create/edit features
Cannot access create/edit features
Solution: Log in to your account. These features require authentication.
Account locked after failed login attempts
Account locked after failed login attempts
Solution: Wait 5 minutes for the lockout period to expire, then try again. Ensure you’re using the correct password.
Cannot log in - email not confirmed
Cannot log in - email not confirmed
Solution:
- Check your email for the confirmation link
- Click “Reenviar correo de confirmación” to get a new link
- Confirm your email before logging in
Password doesn't meet requirements
Password doesn't meet requirements
Solution: Ensure your password has:
- At least 6 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one number
- At least one special character (!@#$%^&*, etc.)
Forgot password
Forgot password
Solution:
- Click “¿Olvidó su contraseña?” on the login page
- Enter your email address
- Check your email for password reset instructions
- Follow the link to set a new password
Logged out unexpectedly
Logged out unexpectedly
Possible causes:
- Session timeout due to inactivity
- Browser cookies cleared
- Application restarted
Technical Implementation Details
For developers and administrators:Identity Configuration
The application uses ASP.NET Core Identity with:- Database: SQLite (via Entity Framework Core)
- Context:
IdentityDataContext - User type:
IdentityUser(default implementation) - Connection string: Environment variable
DATABASE_CONNECTION_STRINGor default path
Data Protection
User data is protected using:Middleware Pipeline
The authentication flow uses:Related Guides
- Managing Teams - Learn about team management features
- Managing Players - Player management guide
- Scheduling Matches - Match scheduling guide