Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

using AD security for authentication. The trust relationship between     the primary domain and the trusted domain failed.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wildman@noclient.net - 29 Feb 2008 15:19 GMT
Hello.

Simple security design, where all intranet users can get to most
pages, but a few ADMIN pages need to be secured to select users. We've
added those users to an AD group.

Whle testing I noticed this returns YES

If (Page.User.IsInRole("USERS")) Then
           Response.Write("YES")
Else
           Response.Write("NO")
End If

and so does this, because im under the admnistrators group on my local
client;

      If (Page.User.IsInRole("ADMINISTRATORS")) Then
           Response.Write("YES")
       Else
           Response.Write("NO")
       End If

However, this test (on a group that does not exsist)  results in the
error:

The trust relationship between the primary domain and the trusted
domain failed.

     If (Page.User.IsInRole("XXX")) Then
           Response.Write("YES")
       Else
           Response.Write("NO")
       End If

I having the network admins add my user to new AD group to test this
out, but am wondering if this is really checking AD groups or just
local groups and what that above error might mean.

Thanks for any help or information.
wildman@noclient.net - 29 Feb 2008 16:01 GMT
Do I have to use  System.DirectoryServices to check if a my intranet
user is in an AD group?

If so, I'm trying this:

   Dim domainAndUsername As String = Page.User.Identity.Name.ToString
       Dim DirectorySearcher As New
System.DirectoryServices.DirectorySearcher()
       Dim LDAPPATH As String = DirectorySearcher.SearchRoot.Path

       Dim entry As New
System.DirectoryServices.DirectoryEntry(LDAPPATH, domainAndUsername,
"xxxx")

       Dim obj As Object = entry.NativeObject
       Dim search As System.DirectoryServices.DirectorySearcher = New
System.DirectoryServices.DirectorySearcher(entry)
       search.Filter = "(SAMAccountName=yyyy)"
       search.PropertiesToLoad.Add("cn") ' ????
       Dim result As System.DirectoryServices.SearchResult =
search.FindOne()

       If result Is Nothing Then
           Response.Write("Nothing")
       Else
           Response.Write(result.Properties.Item("???").ToString())
       End If

The above is not working, I know it's missing stuff.  I'm not clear on
how to search or what to look for.

Thanks for any help or information.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.