mylaff
[SOLVED] IdentityServer scaffolded UI from quickstart does not seem to work
Currently learning ASP.NET Core ecosystem, and as part of the process, I tried to introduce Duende IdentityServer to the system, according to their quickstart guide. However, on the second tutorial "Interactive applications with ASP.NET Core", I ran into a problem of not being able to add UI (Razor pages driven). Tutorial itself is as plain and simple as run
dotnet new isui
template, and then uncomment few lines which add required services and make use of them (specifically speaking app.MapRazorPages()
), however, nothing seem to work, as root path /
returns 404, as every other razor page. IdentityServer itself works though, and serves /.well-known/
.
Options tried:
a) Read everything few more times
b) Reorder AddService
and UseService
few times to no awail (they go in correct order, AFAIK)
c) Ensure pages and other scaffolded template content does exist in the /Pages folder and wwwroot.
d) Rebuild everything few times
e) Follow video-tutorial on Duende YT
Have anyone had something like this?
For context, current HostingExtensions.cs (some parts are ommited for brevity):
3 replies
❔ Web stack and connecting C# backend w/ Next.js frontend
Hey! Recently been learning frontend with React and Next.js, so far so good, however, for my project which is somewhat complex, I think I need a separate backend than the options that Next.js itself provides. Backend REST API and realtime SignalR handles data streamline for the applicaiton. Sounds good on paper, however I'm not entirely sure that it is that simple and more than that I lack understanding how the entire thing will be working, connecting and hosting.
For me as for someone new into that web tech, it looks like this:
I have separate REST API C# project (including SignalR endpoints ig, I don't see point of moving SignalR few endpoints into separate project, however it might be just me), which is being ran in container alongside with other container, running my Next.js frontend, and frontend just uses HTTP requests for API when they are required. This should not trigger CORS as far as I understand, since both things will be ran on the same server, behind the same webserver and URL. But here's the thing, REST API for sure must have an authorization and authentication on barely every endpoint it exposes. And I don't seem to get how do I do authorization in the way that we can then store it and use on frontend app. Is it that simple as calling authorization endpoints at REST API from serverside rendered (or even client side rendered) components and then calling some cookie/idb methods on the Next.js side to mount that data into users browser?
Problem is that I can not imagine the whole image in my head and mentally connect things, decide what techs and interactions I have to learn.
The things I don't fully understand:
- Does Next.js comes with somewhat builtin webserver for production or do I need ngingx to proxy requests? It seems like I do, because I have to route requests between REST App, and frontend App (or am I overlooking something)?
- Already mentioned authorization problem.
I will be really grateful for help.
11 replies