Re: <authentication mode="Windows" /> Question

From: Mike Shaw [MS] (mikeshaw@online.microsoft.com)
Date: 10/23/02


From: "Mike Shaw [MS]" <mikeshaw@online.microsoft.com>
Date: Wed, 23 Oct 2002 13:29:20 +0100


Hi Craig

It looks like what your are doing is corrrect, but sometimes you can get
caught out by the syntax of the string for the role you are testing for.
When you are looking for a domain based group membership, you need to use a
capitalised identity for the domain name. For example: @"MYDOMAIN\mygroup"

The text and case have to be identicle since the comparisson is done via a
hashtable and different cases in the test string will result in different
hash values.

--
Mike Shaw
.NET Developer Group, UK
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. Đ 2002 Microsoft Corporation. All rights
reserved.
"Craig" <craig@compete.com.au> wrote in message
news:b41801c27a3a$77dc18c0$35ef2ecf@TKMSFTNGXA11...
> Hi
>
> I have a intranet web app where I need to check the role
> information of the windows user.  I have set up a role in
> the domain and added me, a domain user to it.  When I
> execute the IsInRole() method, the return value is
> false.
>
> The intention is to allow all authenicated users to
> access the site, users who are in the specified domain
> role have access to admin type features of the site.
>
> Here is my sample code for the page:
>
> WindowsPrincipal wp = (WindowsPrincipal)
> HttpContext.Current.User;
> if(wp.IsInRole("myDomainRole")) {
>   // user in role
> }
>
> ---
>
> Here is the relevant web.config section:
>
> <authentication mode="Windows" />
> <identity impersonate="false" />
>
> In machine.config, I have left the processModel as is -
> default.
>
> ---
>
> In IIS, I have set the virtual web authentication methods
> to 'only' Integrate Windows authenication, the other
> checkboxes are unchecked.
>
> I would greatly appreciate any help in configuring this,
> as I have tired all sorts of ways to make this work.
>
> Regards
>
> Craig


Relevant Pages

  • Re: Change in ASP.Net authentication between Win2000 and Win2003
    ... > is turning on/off Kerberos is occuring. ... It control how IE deals with "Authentication: ... when you put IIS6 in a domain and have "Integrated Windows Authentication" ...
    (microsoft.public.windows.server.security)
  • Re: Change in ASP.Net authentication between Win2000 and Win2003
    ... > is turning on/off Kerberos is occuring. ... It control how IE deals with "Authentication: ... when you put IIS6 in a domain and have "Integrated Windows Authentication" ...
    (microsoft.public.inetserver.iis.security)
  • Re: Need help configuring Wireless Connection profile
    ... and I can only use the intel OR windows utility, not both at the same time. ... Windows authentication for all users,4129,LRG\ryanv,4149,Wireless WPA2 ... SMALL BUSINESS SERVER: ... STEP #1 Install Certificate Services ...
    (microsoft.public.windowsxp.general)
  • RE: Beginners Questions
    ... We do use Windows form on the presentation layer which is on ... terminal server and call web services on the business logic side. ... of using "proxy" authentication on SQL Server. ... > I have written an app with a Windows Forms UI that is deployed to clients ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: form authentication and webservices
    ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... We will be using Windows Authentication on the Web Services side (same ... Dominick Baier ...
    (microsoft.public.dotnet.framework.aspnet.security)