Re: ASP.Net 2.0: Problem User.isinrole() <domain>\<user> instead o



?context.GetType.FullName
"System.Web.HttpContext"
?context.User.Identity.Name
"myDomain\Steve"
?context.User.Identity.IsAuthenticated
True
?context.User.Identity.AuthenticationType
"NTLM"

"Dominick Baier [DevelopMentor]" wrote:

> Hello Dominick Baier [DevelopMentor],
>
> sorry - Context.User.Identity.Name
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
> > Hello Stefan,
> >
> > and what do you see in
> >
> > Context.User.Name
> > and
> > Context.User.GetType().FullName
> > ?
> > ---------------------------------------
> > Dominick Baier - DevelopMentor
> > http://www.leastprivilege.com
> >> Hi Dominick!
> >> Thanks for the reply.
> >> Yes I´m passing the AzMan role to IsInRole.
> >> Like User.IsInRole("roleX")
> >> In AzMan it looks like:
> >> Role Assignments:
> >> -roleX "points at" MyAccountGroup(myDomain\MyAccountGroup)
> >> But it doesn´t work:
> >> ?user.IsInRole("roleX")
> >>> False
> >>>
> >> ?roles.IsUserInRole("Steve", "roleX")
> >>
> >>> True
> >>>
> >> What can be wrong?
> >>
> >> "Dominick Baier [DevelopMentor]" wrote:
> >>
> >>> Hello Stefan,
> >>>
> >>> i guess you set up your authorization store like this
> >>>
> >>> roleX points to domain\GroupX
> >>>
> >>> or similar
> >>>
> >>> you have to pass the name of the AzMan role into IsInRole.
> >>>
> >>> The security trimming feature takes the url in the sitemap file and
> >>> compares
> >>> the users' authorization to the <authorization> element in
> >>> web.config.
> >>> The <authorization> element must use the AzMan role names in the
> >>> allow/deny
> >>> elements.
> >>> ---------------------------------------
> >>> Dominick Baier - DevelopMentor
> >>> http://www.leastprivilege.com
> >>>> Hello!
> >>>> I´m using windowsauthentication in my asp.net 2.0 website. I have
> >>>> some
> >>>> problems using the rolemanager. I´m using the
> >>>> AuthorizationStoreRoleProvider
> >>>> to perform "role checks" against active directory (win 2000).
> >>>> The problem is that the User.Identity.Name is like <domain>\<user>
> >>>> and
> >>>> I
> >>>> think that is what is used when checking roles, but it only works
> >>>> for
> >>>> me if i
> >>>> only supply the <user> when checking a role.
> >>>> Some output :
> >>>> ?user.Identity.Name
> >>>> "myDomain\Steve"
> >>>> ?user.IsInRole("myRole")
> >>>> False
> >>>> ?roles.IsUserInRole("Steve", "myRole")
> >>>> True
> >>>> ?roles.IsUserInRole("myDomain\Steve", "myRole")
> >>>> False
> >>>> The problem here is that I´m using securitytrimming so that the
> >>>> user
> >>>> only see´s links to pages which they have access to and this does
> >>>> not
> >>>> work becuase of this. What can I do about this? Can i change
> >>>> something
> >>>> in my configuration or can I change some property in active
> >>>> directory
> >>>> or something.
> >>>> Thanks In Advance
> >>>> / Stefan
>
>
>
.



Relevant Pages

  • Re: Securing static files
    ... Dominick Baier - DevelopMentor ... they are kicked back to the login page. ... The user may log in with other credentials. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How to determine if the logged on user is in a group
    ... Dominick Baier - DevelopMentor ... I found that you to reboot the SERVER after you create a new group and put users in it so that the new group and the users appear in the whoami list on the server. ... although he is a member of these groups. ...
    (microsoft.public.dotnet.security)
  • Re: HOWTO: Prevent Dynamic Loading of internal Types
    ... Dominick Baier - DevelopMentor ... Henning Krause ... I could get the public key from the entry assembly via ...
    (microsoft.public.dotnet.security)
  • Re: How to call Web Service Securely
    ... which .net version - which type of authentication (username/password against a db??) ... Dominick Baier - DevelopMentor ... make a web method via dialup to my IIS Web Service. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: ASP.NET 2.0 Authorization Roles..Got Solution.
    ... the only difference is see with the provider and a normal WindowsPrincipal is, that the machine name for local groups gets stipped out. ... Dominick Baier - DevelopMentor ... I never used WindowsTokenRoleProvider earlier. ...
    (microsoft.public.dotnet.framework.aspnet.security)

Quantcast