Windows autentication with WindowsPrinicipal

  • Thread starter naijacoder naijacoder
  • Start date
N

naijacoder naijacoder

Hello,
I'm using Windows Authenetication with my code below with
Windows Principal.
I noticed that when i use IsinRole with "BUILT\Administrator its does
work fine but when i use
DomainName\GroupName it doesn't go.
Does anybody know what 'm doing wrong?
Pls forward ur ideas!
Thanks

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
'Dim UserName As String = wp.Name
Dim wp As New WindowsPrincipal(WindowsIdentity.GetCurrent())
'If wp.IsInRole("DomainName\GroupName") Then
If wp.IsInRole("BUILTIN\Administrators") Then
'code
Response.Redirect("welcome.aspx")

End If
If wp.IsInRole("BUILTIN\dministrators") Then
'code
Response.Redirect("Nowelcome.aspx")

End If

End Sub
 
N

naijacoder naijacoder

Hi Paul,
Yeah i wasn't doing impersonation.
Did that and its working fine!
Thx
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top