ASP.NET Identity API in .NET 8

ASP.NET Identity API in .NET 8


I am fond of ASP.NET Identity and using it for Authentication(IDP) from very long times, have used it for multiple enterprise apps. This is out of box feature of .NET framework and tried and tested by Microsoft(Now Open source). One of the challenge I face with this feature is coupling of UI and API. In Case DMZ of NON DMZ I over come this feature by writing the custom API and hosting it in NON DMZ.

With .NET 8 Microsoft has released ASP.NET Identity API which supports Identity as api and now UI can be written in any SPA framework and independent of Database.


Now you can deploy this in any enterprise app without exposing your database to DMZ.

How to enable the ASP.NET Identity API


builder.Services.AddAuthorization();
// Add EF Core
builder.Services.AddDbContext<AppDbContext>(options =>
    options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection")));
    builder.Services
    .AddIdentityApiEndpoints<AppUser>(options => options.SignIn.RequireConfirmedAccount = true)
    .AddEntityFrameworkStores<AppDbContext>();
   

app.MapGroup("/account").MapIdentityApi<AppUser>();

app.UseHttpsRedirection();
app.UseAuthorization(); 
app.Run();        
ASP.NET

Now you can integrate these API with any SPA UI framework.

Sample app: som-nitjsr/aspnetidentityapi (github.com)


要查看或添加评论,请登录

Somnath Shukla的更多文章

  • Generative AI in the Enterprise - Training/Inferencing on-premise

    Generative AI in the Enterprise - Training/Inferencing on-premise

    Despite the potential benefits of Generative AI in improving business processes, workflows, customer experience, and…

  • End to end Encryption with AKS and API Management

    End to end Encryption with AKS and API Management

    I was trying to host micros services in aks behind APIM and wanted to provide end to end encryption. One of the point I…

    6 条评论
  • Sustainability In Public Cloud

    Sustainability In Public Cloud

    I am a big believer in Sustainable Development and try to contribute in my capacity. Earlier I wrote about how this…

  • Sustainability In Private Cloud

    Sustainability In Private Cloud

    I have had the opportunity to Design/Develop a couple of the biggest(in MW) Private Cloud Data Centers in the country…

  • GCP Generative AI

    GCP Generative AI

    Google Released PaLM2 its latest LLM offering. Now you can use it in two ways to work with through Vertex AI Generative…

  • OpenAI and Enterprise and Bot Service

    OpenAI and Enterprise and Bot Service

    With the rise of OpenAI Enterprise can utilize the same in many works flow and customize the OpenAI model with private…

  • Multitenancy in Azure Stack HCI

    Multitenancy in Azure Stack HCI

    Azure Stack HCI a Hyperconverged infrastructure (HCI) solution is one of of the sought after solution in Private Cloud…

  • Cloud Bursting with the Rise of Private Cloud

    Cloud Bursting with the Rise of Private Cloud

    With the rise of Private Cloud there is again the discussion how to utilize/ optimize the Capex in enterprise private…

    2 条评论

社区洞察

其他会员也浏览了