Closed webmedia1012 closed 4 years ago
I'm not sure I understand, is your issue that when users try to access a restricted page and are redirected to login you want this to be a different URL than the default one?
Sorry for the confusion, what I meant was the default login goes to CMS and that’s fine coz I wired it to OrchardCore, but when the page is restricted, meaning it had to go to different login (identity ) and not CMS then it becomes an issue. CMS is for web content management. Sometimes we just want to restrict some page based on identity apart from managing the page.
The URL where the app redirects when the user is challenged is configured here: https://github.com/OrchardCMS/OrchardCore/blob/dev/src/OrchardCore.Modules/OrchardCore.Users/Startup.cs#L144. That is if the other authentication option you're using is Orchard's own. As you can see this is tying into the standard ASP.NET Core Identity framework so your question is general to it, not just Orchard.
I don't know how you can override this in a conditional manner, i.e. the redirect URL somehow depending on the context... Possibly by taking over the redirect in a middleware? If you want to override the URL completely I guess you could modify the cookie settings from a custom module's Startup file or worst case override the route registration but I've never done this so probably others can chime in with a better suggestion.
You can change the property that @Piedone pointed to with your own code. Example: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-configuration?view=aspnetcore-3.1
Hi this is an issue, since we're dealing with IdentityServer there's a separate login path I use, if I use login, it uses the admin login for the CMS and not the IDP., so when I create a restricted page, it goes to Login (CMS ) and not IDP.