Click here to Skip to main content
15,894,540 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

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
 
Share this answer
 
Comments
Sandeep Mewara 5-Jan-13 3:54am    
Use comment feature to interact/respond to an answer.
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
 
Share this answer
 
Comments
Sandeep Mewara 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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900