Setting the Principal on ApplicationContext.User before DataPortal Executes (Http) #3346
Replies: 2 comments 3 replies
-
The custom interceptor looked promising, but we couldn't figure out how to get the token out of the request header (tried injecting both IHttpContextAccessor and HttpContext) and it appeared to fire after the business rules have been checked and this could break functionality if the user's roles have changed. |
Beta Was this translation helpful? Give feedback.
-
Yeah, we started with the middleware approach (and others), but nothing worked until we found the code below. So ultimately, we went back to using middleware and this on both the client and the dataportal side.
Here is the article for others to read ... https://blog.dotnotstandard.com/blog/csla-data-portal-security |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We are trying refresh our claims before the remote DataPortal (server) executes. We tried implementing middleware which didn't work and we tried to implement a custom Interceptor based on the RevalidatingInterceptor, which didn't work.
We implemented a jwt token scheme that sends the token via the authorization header. Blazor WASM sets the header on each request to the server. When the DataPortal request is made, we want to inspect that token, update the roles (in case the roles might have changed) in a way that allows the DataPortal to Revalidate the business rules after we have updated the Principal.
Any ideas on the proper/recommended way to do this?
Beta Was this translation helpful? Give feedback.
All reactions