New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of HttpContextAccessor
in Blazor Interactive Server(?)
#258
Comments
Hello @nwoolls ... It's not used for interactively-rendered components, only static SSR components or statically-rendered root components (e.g.,
... and in the spot that you cross-linked. |
I'm going to open an issue to explain that it's ok in this case for these sample apps. |
Sorry if the line of question is a basic one - I'm coming from MVC and this all seems a bit more complicated. I get that In this case of the OIDC BFF sample, my understanding is that this uses the new Auto Render Mode, meaning that WASM is used once downloaded, and until then Interactive Server (not Static Server / SSR, which would be pre-rendering) is used. If that is the case, wouldn't injecting Thanks in advance for the feedback! |
The ... and keep in mind that when you set the render mode there in the |
I guess I'm not clear on why the I've updated The service - in this case I must be misunderstanding something above as it seems to me like |
Hey @nwoolls I find that very confusing too, did you find any thread that explains this concept more deeply? |
My bad! Sorry ... I was only thinking in terms of server-side static SSR, probably focusing on security scenarios. I didn't realize (or LOOK 👀🙈) at the We need help from @halter73 to explain ... @halter73, the |
I still don't have an answer on this. I'll try pinging Stephen offline again. |
Ok --- I actually messaged Dan and Artak on this one. I think they'll know how the 🧀 moved. The updates to the INCLUDE to address the use of |
Describe the issue
From what I've read, using
HttpContext
andHttpContextAccessor
via Dependency Injection with Blazor Interactive Server is inadvisable, as theHttpContext
used when serving HTML is not the same as the one used by Web Sockets / SignalR. There are numerous posts, GitHub issues, and threads on this:However, the OIDC BFF sample in this repo is using
IHttpContextAccessor
to get the access token.To Reproduce
Steps to reproduce the behavior:
Expected behavior
No use of
IHttpContextAccessor
- instead using circuit handlers. e.g.:Additional context
This is all pretty new to me. I'm working through some different POCs for Interactive Server, Auto Render Mode, etc. I could very much be mistaken above. But in my work on the Interactive Server POC, I used (had to use?) circuit handlers and not
IHttpContextAccessor
. So I was confused to see it in the BFF sample in this repo. Any advise would be appreciated.Issue Details
⚠ Do not edit this section. It is required for issue processing.
The text was updated successfully, but these errors were encountered: