Replies: 3 comments
-
Thank you for finding this @smitic94 - it sounds like some sort of startup timing issue. Needs research for sure! |
Beta Was this translation helpful? Give feedback.
-
Stefan, I am having this exact same issue and I have tried many different ways to solve it, but none have been successful. Have you had any luck resolving this? I would settle for something hacky, if necessary. :) My implementation is actually looking for specific Claims, not necessarily roles. This rule was written just like the IsInRole Common Rule. I am using CSLA 7.0.0 and .NET 7 for the WASM app. Thanks, Ben |
Beta Was this translation helpful? Give feedback.
-
I determined my problem was that I had subclassed CslaAuthenticationStateProvider and overridden GetAuthenticationStateAsync. In this method, I was calling an ASYNC method for reading tokens from local storage. I changed this to a SYNC method and read the token using a SYNC method. This resolved the issue. Essentially, CSLA does not support an ASYNC GetAuthenticationStateAsync method. This is probably a WebAssembly requirement, not a CSLA issue. Hope this helps someone. Ben |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have been exploring Blazor WebAssembly sample, and I am experiencing a behaviour that is odd, in my opinion. I will try to describe how to reproduce this issue:
The described scenario only happens on the first navigation to that page, on next navigation PersonEdit object is created as expected.
Also, when I navigate to this page from "List people" page by clicking "Edit" button, everything works fine.
By creating my own implementation of "IsInRole" class, I found out that "IAuthorizationContext.ApplicationContext.Principal" has no Identities on the first time that the rule is executed, but on the next execution, created ClaimsPrincipal instance is available.
This was the only place where i had problems with ApplicationContext, in every other scenario the correct instance was provided from DI.
Thank you,
Stefan
Beta Was this translation helpful? Give feedback.
All reactions