This project implements a secure authentication API using ASP.NET Core, designed to simulate real-world enterprise and financial systems.
It provides user registration, login, JWT token generation, and role-based authorization for protected resources.
Authentication is a critical component in modern systems, especially in banking, fintech, and enterprise applications.
This project demonstrates how authentication flows are implemented in production environments, including:
- Identity validation
- Secure credential storage
- Token-based authentication
- Role-based access control
- User registration with validation
- Secure password hashing (no plain text)
- Login with credential verification
- JWT token generation
- Role-based authorization (User / Admin)
- Protected endpoints
- Admin-only access control
Controllers → API layer Services → Business logic Data → Database context (EF Core) Models → Domain entities DTOs → Input/output contracts
- User registers with email and password
- Password is hashed before being stored
- User logs in with valid credentials
- API generates a JWT token
- Token is used to access protected endpoints
- Role-based access controls admin routes
POST /api/auth/register
{
"fullName": "Edemar Costa",
"email": "edemar@email.com",
"password": "123456",
"role": "Admin"
}POST /api/auth/login
{
"email": "edemar@email.com",
"password": "123456"
}GET /api/secure/profile
Authorization: Bearer YOUR_TOKEN
GET /api/secure/admin
Authorization: Bearer YOUR_TOKEN
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}dotnet runSwagger:
https://localhost:7018/swagger
- Unique email per user
- Password stored securely (hash)
- Invalid login returns unauthorized
- JWT required for protected endpoints
- Admin routes require role validation
- Password hashing (no plain text)
- JWT with claims (id, email, role)
- Token expiration
- Role-based access control
👉 Add a screenshot or GIF here to show:
- Register
- Login
- Token usage
- Refresh tokens
- Email confirmation
- Password reset flow
- Strong password validation
- Clean Architecture
- Unit tests
- Docker support
Edemar Costa Oliveira
This project is part of a backend portfolio demonstrating:
- Authentication systems
- Security best practices
- JWT implementation
- Real-world API design