using AD security for authentication. The trust relationship betweenthe primary domain and the trust

W

wildman

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.
 
W

wildman

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top