473,396 Members | 1,797 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,396 software developers and data experts.

Authentication ticket

Hello,

I am trying to develop custom form based authentication with active directory with asp.net 2.0 platform. I am having difficulty trying to implement security model. Here is what my senerio is:

After authentication from AD I want to be able to create a custom authentication ticket in which i can save additional information about user other than roles and authenticated usre id, such as the organization name of the user etc.

I realize that I could use sessions to keep additional info but to me that option is the last thing i want to use.

I have done some research on Iprinciple but it seems that you can only add user name and role informaion to that object.

Can some one please give me some direction.
Feb 8 '08 #1
10 3672
Frinavale
9,735 Expert Mod 8TB
Hello,

I am trying to develop custom form based authentication with active directory with asp.net 2.0 platform. I am having difficulty trying to implement security model. Here is what my senerio is:

After authentication from AD I want to be able to create a custom authentication ticket in which i can save additional information about user other than roles and authenticated usre id, such as the organization name of the user etc.

I realize that I could use sessions to keep additional info but to me that option is the last thing i want to use.

I have done some research on Iprinciple but it seems that you can only add user name and role informaion to that object.

Can some one please give me some direction.
Hi Anjummir,

When you create a custom IPrincipal object you must also create a custom IIdentity object. The IIdentity object represents your actual user, whereas the IPrincipal object represents the security context of that user.

The IIdentity object is part of the IPrincipal object.
The IIdentity object can hold extra details about your user.
The IPrincipal object is used to determine what roles/rites the user has...in order to determine what the user is and is not allowed to do.

Does this make sense??

Anyway, if you just want to store a couple of things in the authentication cookie there is a property that you can use when creating the cookie for storing extra details too. This property is called "UserData" and it stores a string containing whatever you would like.

Just be aware that it is less secure to store this extra information in the cookie as apposed to storing it in an IPrincipal (IIdentity) object. Determine how sensitive this extra user information is and place it accordingly.

-Frinny
Feb 8 '08 #2
Thank you very much Frinny for your response. I really want to user Iprincliple. I was just wondering if i can get hold of some sample code? or may be a link?


Hi Anjummir,

When you create a custom IPrincipal object you must also create a custom IIdentity object. The IIdentity object represents your actual user, whereas the IPrincipal object represents the security context of that user.

The IIdentity object is part of the IPrincipal object.
The IIdentity object can hold extra details about your user.
The IPrincipal object is used to determine what roles/rites the user has...in order to determine what the user is and is not allowed to do.

Does this make sense??

Anyway, if you just want to store a couple of things in the authentication cookie there is a property that you can use when creating the cookie for storing extra details too. This property is called "UserData" and it stores a string containing whatever you would like.

Just be aware that it is less secure to store this extra information in the cookie as apposed to storing it in an IPrincipal (IIdentity) object. Determine how sensitive this extra user information is and place it accordingly.

-Frinny
Feb 11 '08 #3
Frinavale
9,735 Expert Mod 8TB
Thank you very much Frinny for your response. I really want to user Iprincliple. I was just wondering if i can get hold of some sample code? or may be a link?
Check out MSDN (that's where I found my information on the Principal and IIdentity objects when I first started developing custom log-ins)

See:
Happy Coding!

-Frinny
Feb 11 '08 #4
I fianally got it working now here is another challenge. lets say we have one web app opened with an authentication ticket in one browser lets call it browser A. Now from browser A client opens up another window, lets call it B, and we want to keep user authenticated for windonw B with the same signon expet one things lets say the location of the user.

Please advise if i can have two simultaneous Iprincilpe objects with the different browsers on the same machine? if not what are my choices?
Feb 17 '08 #5
Frinavale
9,735 Expert Mod 8TB
I fianally got it working now here is another challenge. lets say we have one web app opened with an authentication ticket in one browser lets call it browser A. Now from browser A client opens up another window, lets call it B, and we want to keep user authenticated for windonw B with the same signon expet one things lets say the location of the user.

Please advise if i can have two simultaneous Iprincilpe objects with the different browsers on the same machine? if not what are my choices?
The only way you can have 2 IPrincipal objects is to have 2 different flavors of browsers open at the same time.

Eg. You have it open in Internet Explorer and then open it again in Fire Fox.

Your authentication ticket is issued to the browser and stored as a cookie. These cookies are shared amongst every instance of the browser flavor you are issuing it to.

-Frinny
Feb 17 '08 #6
having two flavours of browsers is not an option. can you think of any other solution to it? i mean having two different sessions on the same machine?
Feb 18 '08 #7
in other words how can i have one variable that has the same variable name but two different values for two different browsers?
Feb 18 '08 #8
Frinavale
9,735 Expert Mod 8TB
in other words how can i have one variable that has the same variable name but two different values for two different browsers?
I'm not sure what you're trying to do here?
Could you explain this in more detail....

having two flavours of browsers is not an option. can you think of any other solution to it? i mean having two different sessions on the same machine?
You can't have two different sessions for the same user (the same web browser).
If a user logs into your system, they are logged in, they'd have to log out to allow another user use the system. You have 1 session per person logged in...

If you explain what you are trying to do in more detail maybe I can help you find the solution to your problem. Right now I'm not sure what you are trying to do.

-Frinny
Feb 18 '08 #9
maryp
1
I believe I'm attempting to do something similar here. I have a web app with forms authentication. What I need is for a user to have multiple instances of IE open and logged in to my system with different username/password credentials. I know it sound odd but I'll save you the details. Just need to be able to have two instances going at the same time while maintaining seperate tickets (ticket has credential info such as roles and db connected to).
Currently, user can do this. The problem is that it appears the tickets are being shared between instances. That is to say, user logs into dbA in one browser and then into dbB in another browser. works fine at first but occassionally, as user clicks around simultaneously in the two apps comparing data, suddently the first browser that started with dbA gets dbB ticket....
I can't seem to create a custom ticket name dynamically b/c the ticketname is defined in the config file.
Thanks for any help
Nov 20 '08 #10
Frinavale
9,735 Expert Mod 8TB
I believe I'm attempting to do something similar here. I have a web app with forms authentication. What I need is for a user to have multiple instances of IE open and logged in to my system with different username/password credentials. I know it sound odd but I'll save you the details. Just need to be able to have two instances going at the same time while maintaining seperate tickets (ticket has credential info such as roles and db connected to).
Currently, user can do this. The problem is that it appears the tickets are being shared between instances. That is to say, user logs into dbA in one browser and then into dbB in another browser. works fine at first but occassionally, as user clicks around simultaneously in the two apps comparing data, suddently the first browser that started with dbA gets dbB ticket....
I can't seem to create a custom ticket name dynamically b/c the ticketname is defined in the config file.
Thanks for any help
I haven't had that problem in IE before...
I could see this occurring if you were using FireFox because only one instance is ever running at a time.

The problem with what you're doing here is that even separate running instances of a browsers may share the same cookies...therefore you may be able to log in using one instance, then again with another instance but as soon as you try to do anything in the first one you'll actually be using the log in from the second.

-Frinny
Nov 20 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: e | last post by:
I'm using forms authentication on a site. When the user logs in via the login page, the entered creds are checked against AD, and if valid, an encrypted forms authentication ticket is produced and...
5
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
0
by: francois | last post by:
hello, I am using forms authentication and I would like that my authentication cookie expires after let say 1 minutes (just for the exemple). When I log in in my longon page, the user has to...
3
by: Martin | last post by:
Dear fellow ASP.NET programmer, I stared using forms authentication and temporarily used a <credentials> tag in web.config. After I got it working I realized this wasn't really practical. I...
0
by: Matt | last post by:
Hello all, We are using Forms Authentication in an application to protect both sensitive ASP.Net pages and Web services. This question is relating to Web services and forms authentication,...
0
by: Sean Patterson | last post by:
Hey all, I've followed the examples online on how to use Forms Authentication to create a ticket, assign it a role, and then intercept it in the Global.asax file to make sure it gets sucked in...
11
by: xenophon | last post by:
I have a web site with forms authentication and a single logon page. I have 4 subdirectories, each that should be protected by a different username/password combination. For testing purposes, the...
0
by: stevecnz | last post by:
I'm looking for feedback on an authentication solution we are considering for an ASP.NET 2.0 project. The site will be accessed by both internal users who are logged into the Windows domain, and...
4
by: =?Utf-8?B?RmFyaWJh?= | last post by:
It know that we can use the following method http://msdn2.microsoft.com/en-us/library/eb0zx8fc.aspx to form authenticate across multiple applications. I have created an asp.net application...
10
by: Peter Bradley | last post by:
We are in the process of designing our first ASP.NET 2.0 application and have discovered that Forms Authentication works completely differently in ASP.NET 2.0. For a number of reasons, we cannot...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.