CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 8/25/2003 1:08:23 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 28 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
ordell
Asp.Net User
User.IsInRole doesn't work8/25/2003 1:08:23 PM

0/0

I Used the GenericPriciple and GenericIdentity to authorize a user, then assigned Context.User the GenericPrinciple object but when i Access the User.IsInRole() i always get a "False" result. The User.Identity.Name however works just fine... What can possibly be wrong?

Also, I'm curious about the Global.asax Application_AuthenticateRequest, should I put the authorization code there, or in my Login.aspx.cs file?
aka
Asp.Net User
Re: User.IsInRole doesn't work8/25/2003 2:10:36 PM

0/0

You have to attache the generic prinicpal to the current user context. usually a good place to do it is the application_authenticaterequest event handler becuase this event is fired on every request.

So move your code that creates a prinicapl and identity object in to the application_authenticaterequest event handler and attache it to to current user.

HTH

-aka
ordell
Asp.Net User
Re: User.IsInRole doesn't work8/25/2003 6:01:48 PM

0/0

Ah, thanks a bunch, that was exactly what I wanted to do!

Is it "good customs" to extend the GenericPricipal class and adding more options, or is the base functionality enough?
aka
Asp.Net User
Re: User.IsInRole doesn't work8/25/2003 6:58:40 PM

0/0

Good.

I am not following the adding more options part in your posting. But all you need is to pass identity and roles information to an instance of Genericprinicpal object.

HTH

-aka
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Learning ASP.NET 3.5 Authors: Jesse Liberty, Dan Hurwitz, Brian MacDonald, Pages: 576, Published: 2008
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005
Expert One-on-One Visual Basic . NET Business Objects Authors: Rockford Lhotka, Pages: 700, Published: 2003
Beginning Visual Web Programming in VB .NET: From Novice to Professional Authors: Daniel Cazzulino, Craig Bowes, Victor Garcia Aprea, Mike Clark, James Greenwood, Chris Hart, Pages: 648, Published: 2005
ASP.NET 2.0 Instant Results Authors: Imar Spaanjaars, Paul Wilton, Shawn Livermore, Pages: 456, Published: 2006
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007

Web:
User.IsInRole doesn't work - ASP.NET Forums User.IsInRole doesn't work. Last post 08-25-2003 3:01 PM by aka. 3 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Why doesn't User.IsInRole work in this context? - Stack Overflow Why doesn’t User.IsInRole work in this context? ... I couldn't find any other syntax that would work in this case. You could probably do this by turing off ...
User.IsInRole Error? - ng.asp-net-forum.security - error problem ... Thanks, Steve Tag: Forms auth. - User.IsInRole() - doesn't work Tag: . ... IsInRole() doesn't work - ASP.NET Forums User.IsInRole("Admin") returns false ...
microsoft.public.dotnet.security: Re: User.IsInRole is always FALSE Jun 9, 2005 ... You may want to step through the code if it doesn't work and find out ... User. IsInRole(@"DOMAIN\Testgroup2"); > > does that make a ...
User.IsInRole does not work for LoggedIn event (login control ... But, I noticed that User.IsInRole doesn't seem to work in this case. In the code below the IF statement never is true, even though I know ...
User.IsInRole is always FALSE Jun 11, 2005 ... bool isInTestgroup2 = Page.User.IsInRole(@"DOMAIN\Testgroup2"); .... You may want to step through the code if it doesn't work and find out ...
ASP.NET 2.0 User.IsInRole works locally but not on server? Nov 22, 2006 ... can anyone please help me out? User.IsInRole works on the locally, but when I put it on the server it doesn't work? ...
Getting current windows user and groups However when trying to compile the following code VS.net doesn't like the User. IsInRole("domain"); With the error "type or namspace for User ...
MSDN Question about: My.User.IsInRole User.IsInRole. Raquel, You were kind enough to reply to an earlier question ... Maybe there'll be a miraculious (ok spekk since that doesn't look spelled ...
microsoft.public.dotnet.framework.aspnet.security: Re: User ... other. > > > > than Administrators, it doesn't work. > > > > microsoft.public. dotnet.framework.aspnet.security: Re: User.IsInRole(...) Re: User.IsInRole(. ...




Search This Site:










access profile provider

sqlmembershipprovider code download and password recovery problem

cannot read xml file

inherits?

security problem :/ (kind of) but it led to someone defacing one of my sites.

enterprise template project

working with master pages?

localization for rtl languages

.net 2.0 schema error

header problem

cache - working with output cache and sql server cache

links module: how do you change font size / color / etc.

pulling empty string from the db

different http request call one sitemap instance? why does that happen?

error hwile using "md5" or "sha1" algorithms

how different is vs.net 2002 from 2003?

website logins not working when running website from cd.

dnn skinning issue

lovely 'unspecified error' using source safe & vs 2005?

how to change dll file without source code

dynamic html and quotation marks

is machinevalidationkey hacker proof?

adding double quotes to web.config

application lose authentication when is posting large data

asp.net control

retrieving e-mail address or description from asp.net configuration

devenv problems with vs studio 2005

remote access of dnn

can't retrieve images from sql server based on dropdown selection, please help

personalization data not upgraded (2.1.2 -> 3.0.13)

 
All Times Are GMT