AUA Framework Training — Episode 19

Login Mechanisms & Architectural Philosophy

Understanding Why Frameworks Matter, Clean Code Principles, and Enterprise Authentication Infrastructure

Watch Video on YouTube

The Power of Structured Architecture

The AUA (Asp.Net Unique Architecture) Framework enables cleaner, faster, more orderly, and business-focused coding. Built on modern concepts such as Clean Architecture, Domain-Driven Design (DDD), Lmax Architecture, SOLID principles, and GRASP, it solves the core challenge of software maintenance: avoiding complexity, task duplication, and project rewrites.

Just like frontend developers rely on utility frameworks like Bootstrap rather than writing raw CSS from scratch for every design, backend developers need a general-purpose, uniform framework to save time, reduce costs, and ensure architectural consistency across teams.

Why Do We Need a Framework?

Many software companies suffer from a lack of standardized development structures, leading to nested, chaotic code where changes in one module break another. Architectural patterns are not arbitrary inventions; they embody years of collective experience from hundreds of software engineering professionals designed to achieve maximum flexibility, extensibility, and reusability.

Minimum Benefits of Using AUA Framework

Reducing Development Costs

Minimize overhead and optimize resource allocation across teams.

Saving Time

Pre-built, thoroughly tested modules accelerate feature delivery.

Convenient Maintenance

Uniform code structures make debugging and scaling effortless.

Quality Product

Deliver enterprise-grade performance and rock-solid reliability.

Selected AUA Framework Features

Service architecture infrastructure based on modern patterns.
Robust reporting and data extraction infrastructure.
Seamless integration handling views, database procedures, and tables.
Advanced encryption algorithms and strict security considerations.

1. Login Business Service Implementation

AccountBusinessService.cs

This implementation demonstrates how AUA processes user authentication by validating credentials using password hashing and generating encrypted JWT tokens for API communication.

public class AccountBusinessService : BaseBusinessService, IAccountBusinessService
{
    private readonly IAppUserService _appUserService;
    private readonly IAccessTokenProviderService _tokenProvider;

    public AccountBusinessService(
        IUnitOfWork unitOfWork,
        IAppUserService appUserService,
        IAccessTokenProviderService tokenProvider) : base(unitOfWork)
    {
        _appUserService = appUserService;
        _tokenProvider = tokenProvider;
    }

    public async Task<ResultModel<LoginResultDto>> LoginAsync(LoginVm loginVm)
    {
        // 1. Encrypt raw password with AUA Encryption Provider
        var hashedPassword = EncryptionHelper.ToSha256(loginVm.Password);

        // 2. Query user entity
        var user = await _appUserService.FirstOrDefaultAsync(x => 
            x.UserName == loginVm.UserName && x.Password == hashedPassword);

        if (user == null)
            return Error<LoginResultDto>("Invalid username or password");

        if (!user.IsActive)
            return Error<LoginResultDto>("User account is inactive");

        // 3. Issue JWT Access Token
        var token = _tokenProvider.GenerateUserToken(user.Id, user.UserName);

        return Success(new LoginResultDto
        {
            AccessToken = token,
            UserId = user.Id,
            UserName = user.UserName
        });
    }
}

2. Auth API Controller Endpoint

AccountController.cs

The API controller action exposes the login endpoint, processing credentials securely and returning structured responses via ResultModel.

[ApiController]
[Route("api/[controller]")]
public class AccountController : BaseApiController
{
    private readonly IAccountBusinessService _accountBusinessService;

    public AccountController(IAccountBusinessService accountBusinessService)
    {
        _accountBusinessService = accountBusinessService;
    }

    [HttpPost("[action]")]
    public async Task<ResultModel<LoginResultDto>> Login([FromBody] LoginVm model)
    {
        return await _accountBusinessService.LoginAsync(model);
    }
}
“
”
"If you think good architecture is expensive, try bad architecture."
AUA Framework Philosophy

Official Channels & Community

Connect with the AUA Framework ecosystem.

Episode 19 Completed Validation Service