0

I've started from the default react template for Asp.Net Core 6. Changed the ApplicationUser default key. Tinkered a bit the Program.cs - everything else is the same as in the default template.

builder.Services.AddIdentity<ApplicationUser, ApplicationRole>(config => {
        config.SignIn.RequireConfirmedAccount = true; 
    })
    .AddEntityFrameworkStores<ApplicationDbContext>()
    .AddDefaultUI() 
    .AddDefaultTokenProviders();

builder.Services
    .AddIdentityServer()
    .AddApiAuthorization<ApplicationUser, ApplicationDbContext>();

In order to customise the IdentityUI I've scaffolded all of it. Changed the markup, and added custom CSS + images to the static folder. The specific file structure is:

wwwroot \ dist  
wwwroot \ dist \ site.css
wwwroot \ dist \ logo.svg

as this is undocumented I had to stumble around StackOverflow a bit

In order to make this work in dev I've customised the ClientApp\src\setupProxy.js

const context =  [
  "/_configuration",
  "/.well-known",
  "/Identity",
  "/connect",
  "/ApplyDatabaseMigrations",
  "/_framework",
  "/dist", // This line is added
  "/api"   // Also this line is added
];

But when deployed to a AzureWebApp (Linux Image), Kestrel doesn't serve these two files. I've checked the contents of the published folder - the files are present. So it's a configuration issue.

Kestrel request https://stubname.com/dist/site.css returns 404.

P.S. the fast hack was to move the css and images to ClientApp\public folder but this doesn't look like a proper solution

What am I missing?

Ion Ciobanu
  • 506
  • 4
  • 13

0 Answers0