I have a webpage that, when in LocalHost mode, finds an inside user within an Active Directory group.
But when I publish it to the website, it finds the user thats logged in, but not the group the user is in.
Code behind:
Public Function IsInADGroup(ByVal GroupName As String)
Dim MyIdentity As System.Security.Principal.WindowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent()
Dim MyPrincipal As System.Security.Principal.WindowsPrincipal = New System.Security.Principal.WindowsPrincipal(MyIdentity)
If MyPrincipal.IsInRole(GroupName) Then
Return True
Else
Return False
End If
End Function
If IsInADGroup("RTT-Update") Then
Response.Redirect("~/RTTList.aspx")
End If
Web.config:< ...
Go to the complete details ...