I have 2 websites , web1 has a login page , web2 has restrict access to page , I dont want to require the user to login in web2 , what i need if the user has succesfully logged in to web1 , if he clicks on a link that redirects him to web2 pages that are
restricted he can browse these pages without entring the credentials again
1) You can pass encrypted username and password into query string and based on query string you can do the login
2) in both web site in same domain ot sub domain then you can acess authintication cookie and based on cookie you will do the sign in into second we site.
3) you can create common web site for authentication like google
check following links for some example and exampaination
I have 2 websites , web1 has a login page , web2 has restrict access to page , I dont want to require the user to login in web2 , what i need if the user has succesfully logged in to web1 , if he clicks on a link that redirects him to web2 pages that are
restricted he can browse these pages without entring the credentials again
any example ? ???
Hi senior_oracle,
First of all you can use the common data store for both the website against which authentication should take place.
Secondly what you can try to do is create a cookie once user logs in website 1 and try to access the same cookie for website 2 which eventually will use same information for login. So you are nothing but sharing a cookie across applications. You will need to
add few properties in your web.config. Following article will help you in the same:
http://msdn.microsoft.com/en-us/library/eb0zx8fc.aspx.
So if you're using forms auth you need to simply configure the <machineKey> in web.config of the two apps to be the same values. The
link @Amy provided you with is what you need to follow.
senior_oracl...
Member
30 Points
163 Posts
Single Sig on
Nov 07, 2012 08:00 AM|LINK
I have 2 websites , web1 has a login page , web2 has restrict access to page , I dont want to require the user to login in web2 , what i need if the user has succesfully logged in to web1 , if he clicks on a link that redirects him to web2 pages that are restricted he can browse these pages without entring the credentials again
any example ? ???
dhol.gaurav
Contributor
3998 Points
725 Posts
Re: Single Sig on
Nov 07, 2012 08:22 AM|LINK
Hey,
There are many ways to impliment single sign on
1) You can pass encrypted username and password into query string and based on query string you can do the login
2) in both web site in same domain ot sub domain then you can acess authintication cookie and based on cookie you will do the sign in into second we site.
3) you can create common web site for authentication like google
check following links for some example and exampaination
http://msdn.microsoft.com/en-us/library/dd577079.aspx
http://www.codeproject.com/Articles/27576/Single-Sign-on-in-ASP-NET-and-Other-Platforms
http://www.codeproject.com/Articles/106439/Single-Sign-On-SSO-for-cross-domain-ASP-NET-applic
let me know if any query
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer
Alsaady
Participant
1736 Points
357 Posts
Re: Single Sig on
Nov 07, 2012 10:29 AM|LINK
Is Web1 and Web2 on the same Server ? or on different server ?
www.rtoosh.net
Amy Peng - M...
Star
10110 Points
954 Posts
Microsoft
Re: Single Sig on
Nov 08, 2012 04:15 AM|LINK
Hi senior_oracle,
First of all you can use the common data store for both the website against which authentication should take place.
Secondly what you can try to do is create a cookie once user logs in website 1 and try to access the same cookie for website 2 which eventually will use same information for login. So you are nothing but sharing a cookie across applications. You will need to add few properties in your web.config. Following article will help you in the same: http://msdn.microsoft.com/en-us/library/eb0zx8fc.aspx.
The following article give a exanple about Single Sig on code, please try to refer to: http://www.jitbit.com/forum/topic228-single-sign-on-example-code.aspx .
Regards,
Amy Peng
Feedback to us
Develop and promote your apps in Windows Store
senior_oracl...
Member
30 Points
163 Posts
Re: Single Sig on
Nov 08, 2012 06:41 AM|LINK
on the same server
BrockAllen
All-Star
27512 Points
4895 Posts
MVP
Re: Single Sig on
Nov 08, 2012 02:01 PM|LINK
So if you're using forms auth you need to simply configure the <machineKey> in web.config of the two apps to be the same values. The link @Amy provided you with is what you need to follow.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/