Windows autentication with WindowsPrinicipal

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Windows autentication with WindowsPrinicipal

    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

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    naijacoder naijacoder Guest

  2. Similar Questions and Discussions

    1. Problems with User Autentication
      I am trying to develop a login page for my website using a table with userID and Password through a coldfusion interface. I used some of the code...
    2. Windows autentication PROBLEMS
      HI I was using Windows Authentication before in my LOCALHOST with BuiltIN/Administrator(And i was getting DOMAIN\USERNAME and it was working now ...
    3. Acrobat Printers Missing in Printer Folders after Windows XP Upgrade from Windows Me
      I just upgraded one of my computers from Windows Me to Windows XP Home. The computer had Adobe Acrobat 5.0.5 installed within the Windows Me. Now...
    4. Forms autentication and registration page - some advices
      Hi, I implement forms authentication in my application. So I have a login form. Actually I have two custom Web controls, one to login and one to...
    5. How to return a keyvalue from popup windows with datagrid control to parent windows through JavaScript?
      How to return a keyvalue from popup windows with datagrid control to parent windows through JavaScript?
  3. #2

    Default Re: Windows autentication with WindowsPrinicipal

    Are you using impersonation in your web.config?

    --
    - Paul Glavich
    Microsoft MVP - ASP.NET


    "naijacoder naijacoder" <naijacoder@toughguy.net> wrote in message
    news:e94t3dkjEHA.156@TK2MSFTNGP10.phx.gbl...
    > 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
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Paul Glavich [MVP - ASP.NET] Guest

  4. #3

    Default Re: Windows autentication with WindowsPrinicipal

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


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    naijacoder naijacoder Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139