Can SiteB Restrict Access Only to Users Authenticated on Site A? How?
I have recently been asked to estimate a piece of work which will provide functionality for authenticated users to access our site. The thing is, the user has to authenticate on a different site & domain to the one we are hosting.
The user authenticates on SiteA.com and they are provided with a link to our site, SiteB. Only users who have authenticated on SiteA are allowed to access SiteB.com.
I don't yet know what authentication system SiteA is using, but I thought I'd ask the开发者_JAVA百科 community for some initial thoughts. Is this even possible? What do I need to consider?
Thanks
Single Sign On is possible using Forms Authentication. Here are the steps:
- Configure both sites for forms authentication and setup same machine keys (this is important for step 4).
- User authenticates on SiteA.com and a cookie is issued for him on this site.
- Forge a link on SiteA that would POST a form containing the authentication cookie value in a hidden field to a page on SiteB.com that doesn't require authentication (make sure you post only over HTTPS).
- The page on SiteB.com reads the value of the posted token, decrypts it and issues an authentication cookie for SiteB.com using FormsAuthentication.GetAuthCookie
- Redirect to the authenticated part of SiteB.com
精彩评论