Very strange "trust relationship" error when calling User.IsInRole...

Very strange "trust relationship" error when calling User.IsInRole...

Old forum URL: forums.lhotka.net/forums/t/2064.aspx


JCannelos posted on Tuesday, January 02, 2007

Guys,

As strange error started happening today - when I call ApplicationContext.User.IsInRole("SiteManager"), I get an error that states "The trust relationship between this workstation and the primary domain failed."?? I've never heard of this error. All parts (Csla, my business objects, my web app, database) are all on my local laptop and running in debug mode. I have not really set up my login page yet, but if anything I should be getting "Security Exception: Can not add Company" rather than this! :(

Anyone come across this before?

Thanx!

J'son

ajj3085 replied on Tuesday, January 02, 2007

Try rebooting.  Failing that, you'll have to remove the workstation from the domain, reboot and rejoin the workstation to the domain.

The problem is that the cert for the workstation got out of sync with the cert the dc expects. 

HTH
Andy

JCannelos replied on Tuesday, January 02, 2007

Andy,

Ok, well.. I just added the following line to my web.config that fixed the problem:

<roleManager enabled="true" />

Not really sure what this does though and if that will mess me up later when I finally add in my <membership defaultProvider... /> piece.

The weird thing is that main part of my static CanAddObject() method looks like this:

return (ApplicationContext.User.IsInRole("Administrator") || ApplicationContext.User.IsInRole("SiteManager"));

The "Administrator" role check happens fine, but the trust domain error happens when the "SiteManager" role is checked. Weird, eh?

Thanx for the domain tip. I'll look into that.

J'son

ajj3085 replied on Tuesday, January 02, 2007

It probably fixed it because the membership provider isn't going against the Active Directory anymore, whereas previously it was. 

The error message you're getting indicates that whatever domain your laptop (the web server is on the laptop, correct?) belongs to isn't trusting the laptop anymore.  

I actually had this happen on a workstation here, but it happened when the workstation was trying to connect to the Sql Server, which used Integrated Security, because .  The unjoin / rejoin solution resolved this.

JCannelos replied on Tuesday, January 02, 2007

Good stuff... thanx for your help!

J'son

Copyright (c) Marimer LLC