6

I have my asp.net web server setup to use windows authentication.

It is authenticating just fine with my current logged in user.

I can verify this by viewing ...

HttpContext.Current.User.Identity.Name

And I can verify that I am authenticated by viewing...

HttpContext.Current.User.Identity.IsAuthenticated

However, when I call the .IsInRole function I get the trust relationship error...

HttpContext.Current.User.IsInRole("accounting")

I have found online references to problems with supplying domain name with the role name (domain\accounting), but I still get the same error. Any suggestions on where to look or troubleshoot the problem?

yamspog
  • 18,173
  • 17
  • 63
  • 95

1 Answers1

9

Well, it seems that if you are referencing a Role that doesn't exist then you get the trusted domain error.

The error went away and the code functioned just fine when I changed from ...

HttpContext.Current.User.IsInRole("accounting") 

to the actual group name ...

HttpContext.Current.User.IsInRole("rsi_accounting") 
yamspog
  • 18,173
  • 17
  • 63
  • 95
  • I'm running into this problem as well. Did you actually have multiple domains/forests with (or without) trust between them? – JoeBrockhaus Mar 19 '14 at 19:24
  • 1
    I had this issue when running two load-balanced servers in the same domain - one could handle a non-existent group, the other couldn't! Never worked out why... – Jonathan Sayce Dec 09 '14 at 16:20