Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IdentityServer not showing custom view

I am trying to follow this guide https://identityserver.github.io/Documentation/docs/advanced/customizingViews.html by adding an assets folder to the root of my web application and placing a login.html there.

However when the navigation brings me to https://localhost:44343/identity, the login page I see is still the default one.

What am I doing wrong, why doesn't it pick up the overridden login page? I'm using IdentityServer3 2.5.0.

like image 902
Adam Szabo Avatar asked Dec 06 '25 07:12

Adam Szabo


1 Answers

Found the solution:

As I'm using IdentityServerServiceFactory I need to configure the Default View Service to look at the /Assets folder:

var factory = new IdentityServerServiceFactory();

// more code...

var assetsDirectory = System.Web.Hosting.HostingEnvironment.MapPath("~/Assets");
factory.ConfigureDefaultViewService(new IdentityServer3.Core.Services.Default.DefaultViewServiceOptions { CustomViewDirectory = assetsDirectory });
like image 55
Adam Szabo Avatar answered Dec 11 '25 14:12

Adam Szabo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!