How do I retreive the username from the JWT token in ASP.NET C# WebApi?
  In ASP.NET C# WebAPI, you can retrieve the username from a JSON Web Token (JWT) by using the `System.IdentityModel.Tokens.Jwt` library. Here's an example of how to do this:

1. First, add the `System.IdentityModel.Tokens.Jwt` nuget package to your project:
```
Install-Package System.IdentityModel.Tokens.Jwt
```
2. Next, create a middleware function that will handle the JWT token validation and extraction of the username. Here's an example of how to do this:
```
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace MyApp.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class MyController : ControllerBase
    {
        // Middleware function to handle JWT token validation and username extraction
        public void Configure(HttpApplication app, IWebHostEnvironment env)
        {
            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapCont
The username can be retrieved from the JWT token by parsing the token. The JWT token should be base64-encoded, so first the base64 encoding should be removed. After that, the token can be split into three parts: the header, the claims, and the signature. The username can be found in the claims section.