473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

new GenericPrincipal(user.Name, roles);

Hi,

When adding roles to the GenericPrincipal, is this a per request
object or is it in session?

In my global.asax.cs , which event should I be adding the roles to the
GenericPrincipal?
Dec 17 '07 #1
1 3901
The roles that you are assigning to the constructor for the
GenericPrincipal instance are valid for the lifetime of the GenericPrincipal
instance.

It all depends on what you are doing with the GenericPrincipal instance
you are constructing, and where you are holding a reference to it. If you
store it in the session, then it will last for the session, if you use it
only during the processing of a page, it will only last for the processing
of the page.

Why are you not using one of the custom membership providers for
ASP.NET? It would probably make what you are doing MUCH easier.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DotNetNewbie" <sn***********@yahoo.comwrote in message
news:dd**********************************@e23g2000 prf.googlegroups.com...
Hi,

When adding roles to the GenericPrincipal, is this a per request
object or is it in session?

In my global.asax.cs , which event should I be adding the roles to the
GenericPrincipal?
Dec 17 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
2
by: Ed | last post by:
Hi I currently have an asp.NET project. I'm using Access 2003 and forms authentication to authenticate users. Can anyone tell me how to set the roles in asp.NET so that it recognizes them? The...
4
by: Jamie Pollard | last post by:
hello, i have been scouring the groups for the best possible solution to this problem, but can't seem to find my exact scenario, so hopefully someone can get me back on the right path. my...
3
by: Harold Crump | last post by:
Greetings, I need to implement GenericPrincipal based authentication without using ASP.NET Forms Authentication. I know it is much simpler using Forms Authentication, but in this case, I have...
2
by: Joyce | last post by:
Hi, Can I return GenericPrincipal from Web Services? The following error displays when I try to return GenericPrincipal from Web Services. System.Security.Principal.GenericPrincipal cannot be...
2
by: Jules | last post by:
When creating this website I user a custom authentication method to validate the usercredentials (I think the membership provider is an overkill since I only use the authentication part). When I...
3
by: tshad | last post by:
I am playing with GenericPrincipal classes and am using a sample program to test it. The problem is that even though I set the roles (which shows the roles in the Context.User as being there),...
0
by: Nick | last post by:
I am working on a web based application in which all "roles" are stored in the database. When a user logs in their roles are then transferred to a comma delemited string, saved to a cookie, etc......
11
by: giddy | last post by:
hi, (I want someone to check if my idea is utterly stupid or ok??) I have a mid complex app for a hotel that needs a fine grained user security system. In other words an admin should be able...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.