The trust relationship between this workstation and the primary domain failed

Discussion in 'ASP .Net Security' started by Namshub, Jun 28, 2006.

  1. Namshub

    Namshub Guest

    Hi, I'm using Visual Studio 2005 and I'm currently working at home, this
    line of code works perfectly well online
    If Not (HttpContext.Current.User.IsInRole(SecurityGroup)) Then

    But when run disconnected from the network I get the error below. Is this
    correct? Is there a different line to determine if i'm in a group which uses
    cached credentials????

    Regards

    Ric


    System.SystemException was unhandled by user code
    Message="The trust relationship between this workstation and the primary
    domain failed.
    "
    Source="mscorlib"
    StackTrace:
    at
    System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection
    sourceAccounts, Boolean& someFailed)
    at
    System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection
    sourceAccounts, Type targetType, Boolean& someFailed)
    at
    System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection
    sourceAccounts, Type targetType, Boolean forceSuccess)
    at System.Security.Principal.WindowsPrincipal.IsInRole(String role)
    at DieteticViewer.Global.Application_AuthenticateRequest(Object
    sender, EventArgs e) in
    c:\inetpub\wwwroot\DieteticViewer\App_Code\Global.asax.vb:line 55
    at
    System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
    Boolean& completedSynchronously)
     
    Namshub, Jun 28, 2006
    #1
    1. Advertising

  2. This is probably because the LSA doesn't have the group name cached, so when
    it goes to look it up, it has to ask the domain controller and can't since
    you aren't online. I don't think you have much of an option if you are
    using Windows authentication though.

    You might consider switching to forms authentication for testing purposes
    and then use Windows auth for staging and production. I do that frequently.
    You can make forms auth do whatever you want, so it is pretty flexible.

    Joe K.

    --
    Joe Kaplan-MS MVP Directory Services Programming
    Co-author of "The .NET Developer's Guide to Directory Services Programming"
    http://www.directoryprogramming.net
    --
    "Namshub" <> wrote in message
    news:...
    > Hi, I'm using Visual Studio 2005 and I'm currently working at home, this
    > line of code works perfectly well online
    > If Not (HttpContext.Current.User.IsInRole(SecurityGroup)) Then
    >
    > But when run disconnected from the network I get the error below. Is this
    > correct? Is there a different line to determine if i'm in a group which
    > uses cached credentials????
    >
    > Regards
    >
    > Ric
    >
    >
    > System.SystemException was unhandled by user code
    > Message="The trust relationship between this workstation and the primary
    > domain failed.
    > "
    > Source="mscorlib"
    > StackTrace:
    > at
    > System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection
    > sourceAccounts, Boolean& someFailed)
    > at
    > System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection
    > sourceAccounts, Type targetType, Boolean& someFailed)
    > at
    > System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection
    > sourceAccounts, Type targetType, Boolean forceSuccess)
    > at System.Security.Principal.WindowsPrincipal.IsInRole(String role)
    > at DieteticViewer.Global.Application_AuthenticateRequest(Object
    > sender, EventArgs e) in
    > c:\inetpub\wwwroot\DieteticViewer\App_Code\Global.asax.vb:line 55
    > at
    > System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    > at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
    > Boolean& completedSynchronously)
    >
    >
     
    Joe Kaplan \(MVP - ADSI\), Jun 28, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve M
    Replies:
    3
    Views:
    27,462
    dar7ren
    May 27, 2009
  2. =?Utf-8?B?bXVzb3NkZXY=?=

    vs2005: domain trust relationship problem

    =?Utf-8?B?bXVzb3NkZXY=?=, Jan 12, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    4,523
    Steven Cheng[MSFT]
    Jan 17, 2006
  3. Replies:
    1
    Views:
    998
  4. Linda
    Replies:
    1
    Views:
    550
    Dominick Baier
    Aug 31, 2006
  5. MrGrundh
    Replies:
    0
    Views:
    1,181
    MrGrundh
    Aug 27, 2009
Loading...

Share This Page