Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Map IdentityServer4 to "/identity", then map UI

My application is basically this one: https://github.com/IdentityServer/IdentityServer4.Quickstart.UI

But I'm trying to map it to "/identity" using this piece of code:

app.Map("/identity", builder => { builder.UseIdentityServer(); });

It's working well, I can access /identity/.well-known/openid-configuration successfully.

However, if I try to connect, the application redirects me to /identity/account/login, which is on the IdentityServer side. IdentityServer cannot find my controller, so it returns me 404.

I tried to the LoginUrl property:

services.AddIdentityServer(options =>
{
    options.UserInteraction.LoginUrl = "/bleh/account/login";
})

But it also returns 404.

I also tried to make the Quickstart controller route the same as the redirect one:

[Route("identity/account/login")]

But it also returns 404.

Any idea?

like image 357
Gabriel Robert Avatar asked Jun 08 '17 19:06

Gabriel Robert


1 Answers

If anyone is still looking for this. This worked for me:

app.Map("/identity", builder => {
    builder.UseStaticFiles();
    builder.UseIdentityServer();
    builder.UseMvcWithDefaultRoute();
});
like image 84
John Avatar answered Oct 05 '22 04:10

John