Open afun-entp opened 1 year ago
Hi @afun-entp,
I'm looking into this issue and am curious what form of exception handling you are looking for. Would you want an ignore flag that basically traps the exception and ignores that instance (i.e. IsInRole won't be satisfied by the failing request, but could get populated as it cycles through others), some sort of retry policy, a combination of both or something else? Can you clarify what a successful resolution of this issue would look like for you?
Thank you for your response!
I don't have an understanding of the technical complexity behind the scenes, so this may be a very naive perspective... but here goes:
Most effective - prevention: A flag that allows or prevents resolution and traversal of Trusted Domains when calling .IsInRole()
Since many applications are only going to be targeted to memberships within a single domain context, traversing external trusted domains adds wait time overhead as well as opening the opportunity for cross domain issues. {Interruptions of service in this case. But, I'm also curious if domain trusts might open up "membership confusion" when both domains have identically named groups. }
Metaphorically, IsInRole automatically checking Trusted Domains is like a postal worker trying to enter your neighbor's house before they decide whether or not to deliver your mail. You and your neighbor may have high degrees of trust with each other, and you may have shared keys with each other for just in case... but ideally you both want tight control over whether or not an activity piggybacks on that.
So to me; my ideal magic-wand solution would be an option on the .NET level that allows or prevents Trusted Domain resolution, and then implementing that into Blazor's
Next most effective - trapping: Since Blazor's AuthorizeView component calls IsInRole() the end developer does not have the option of implementing a Try/Catch at that level.
So a flag for trapping would indeed be a way of allowing the process to cycle forward to see if a non-domain role has been assigned by the application.
Hello Guys,
I have the same issue; it occurs when my Blazor application starts and does the domain validation. I’m getting the following error:
Win32Exception: The trust relationship between the primary domain and the trusted domain failed.
It works if I run the app on the same domain as the IIS server, but if I run from any other domain, I get the error. It is weird because I have access to the domain and shared resources. It seems to be an Active Directory problem, but I would like to know if I can skip that validation. I’ve done some research on the Internet but no solution until now, any help will be appreciated.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Is there an existing issue for this?
Describe the bug
Manual use of .IsInRole() or invocation of a user principal role check through the use of Blazor's AuthorizeView component, will by default transverse all windows domain trusts when in an Active Directory context.
This creates a weak point in deployed applications within multi-domain environments, since interruption of contact with any trusted domain will cause exception status for all running instances within the primary domain.
This impact is not limited by:
Expected Behavior
I expected to find either:
Steps To Reproduce
True reproduction requires the configuration of an Active Directory domain trust, and then severing the access to the trusted domain. (For anyone seeking to truly reproduce, the simplest method might be to intentionally create a DNS failure between 2 testing domains.)
Here is example code of .IsInRole() being called manually, illustrating fairly common use:
...
Here is example code of Role checking being invoked through Blazor's AuthorizeView component:
Both result in identical exception.
Exceptions (if any)
Win32Exception: The trust relationship between the primary domain and the trusted domain failed
( Exception details captured from Blazor application )
.NET Version
7.0.302
Anything else?
It is possible to find multiple occurrences of this issue being discussed on sites like StackExchange, but most discussions are obscured by the fact that it is an environment specific risk (and frankly many developers don't have the Domain administration background to fully understand the context).