Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi,all!
 
I build a small Asp.net website and use windows authentication. Now I want to get user information after windows authentication and convert it to a new user object in another website and save it to cookie or just save the user information to database. Then another web application can access such information.
 
Who can give me some suggestion?
 
Thanks.
Posted 4-Jan-13 6:51am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can use cookies to store information that is available between sites. You mentioned cookies, so you seem to know that. What other info do you want ? Storing info in the DB won't help, you still need users to log in to both sites to know what data is theirs
  Permalink  
Comments
Sandeep Mewara at 5-Jan-13 3:54am
   
Comment from OP:
 
Hi, Christian Graus, thanks for your replay. I think I should describe my question more detail.
I'm builing a small Asp.net MVC website, and I try to make it flexible enough to fit user's requirement. You know, some user use domain and some one did not use it. So my web application should support form autherization and windows autherization, then user can select how to use my system.
I set my application to use form autherization, because I realy need a user list in my system. For the user who use domain, I will copy all the domain account to my system automatically and frequently. I build another website just for windows autherization. In this website, I want to get the user domain account and convert it to the user in my system.
So far, I can get the user name from HttpContext.Current after windows autherization, but when the request redirect from windows autherization to the real web application site, I can not see the user information in HttpContext.Current. I have putted the two websites in same domain. I know two web sites in same domain can share same form autherization cookies, but I'm not sure can they share the autherization cookies even they use different autherization method. This why I post my question.
If the tow web sites in same domain but use different autherization method can not share cookies information, I think what I can do is gather the user information in windows autherization site and save it in database, and redirect to the another web site. In the next web site, I can read the record the first site create. Then I can get the user information and user can use windows autherization.
I still won't to do like this way, even though it seem feasible. I think share cookie in the two web site is more offical.

So My real question is:
1、Tow websites in same domain but use different autherization mothod can share the user information or not?
2、If it can, how can I do it?

Thanks
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi, Christian Graus, thanks for your replay. I think I should describe my question more detail.
I'm builing a small Asp.net MVC website, and I try to make it flexible enough to fit user's requirement. You know, some user use domain and some one did not use it. So my web application should support form autherization and windows autherization, then user can select how to use my system.
I set my application to use form autherization, because I realy need a user list in my system. For the user who use domain, I will copy all the domain account to my system automatically and frequently. I build another website just for windows autherization. In this website, I want to get the user domain account and convert it to the user in my system.
So far, I can get the user name from HttpContext.Current after windows autherization, but when the request redirect from windows autherization to the real web application site, I can not see the user information in HttpContext.Current. I have putted the two websites in same domain. I know two web sites in same domain can share same form autherization cookies, but I'm not sure can they share the autherization cookies even they use different autherization method. This why I post my question.
If the tow web sites in same domain but use different autherization method can not share cookies information, I think what I can do is gather the user information in windows autherization site and save it in database, and redirect to the another web site. In the next web site, I can read the record the first site create. Then I can get the user information and user can use windows autherization.
I still won't to do like this way, even though it seem feasible. I think share cookie in the two web site is more offical.
 
So My real question is:
1、Tow websites in same domain but use different autherization mothod can share the user information or not?
2、If it can, how can I do it?
 
Thanks
  Permalink  
Comments
Sandeep Mewara at 5-Jan-13 3:54am
   
Use comment feature to interact/respond to an answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Kornfeld Eliyahu Peter 430
1 OriginalGriff 299
2 Nelek 115
3 Sergey Alexandrovich Kryukov 99
4 Gihan Liyanage 99
0 Kornfeld Eliyahu Peter 420
1 OriginalGriff 140
2 Gihan Liyanage 99
3 Nelek 65
4 sankarsan parida 65


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 5 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100