login to multiple web sites by login only once at a my site
I want to create a site in php such that, when user would login to my website, then they can add their favorite website and enter its login information once. My site will save his login information for other site开发者_如何学Cs in my database, and the next time, user logged onto my website need not to enter his login information to other sides again. My site will automatically do this for them.
I am not sure whether this is possible or not. As I am a beginner in php. Also would javascript be useful for this?
Would it be possible to do this by limiting this feature to some fixed websites?
Ankur
Assuming that the sites are arbitrary third parties, then this is impossible (and if it were not then users using your service would probably be violating the terms and conditions of most of the sites they used you to access by sharing their passwords).
If you control the sites, then the key-phrase to search for is single sign on
If the sites are ones that buy into using third party authentication then you want to be an OpenID Provider (stackoverflow is an OpenID Consumer, which is why you can log in by using (for instance) your Flickr photo page URL).
There are a couple of solutions to this.
One is to open an HTTP connection from your server to the third-party website and have your server act as a browser. This effectively turns your server into a web proxy, but gives you the opportunity to manipulate data as it's passed through to the client.
The other option is to pass login and url information back to the browser and open these connections via JavaAscript, using XmlHttpGet, jQuery, spawning new windows that hit that target site directly, etc.
In short, there are as many ways to go about this as their are opinions.
I think you are looking at making your site an OpenId provider.
For other web sites to agree to using your web site as id provider, they must collaborate with you to have a common set of security and authentication measures. The only widespread collaboration today is OpenId. For example, I am logged into this site using my google OpenId. Therefore, google is the OpenId provider and this web site is the OpenId consumer/dependant.
I am only aware of openid libraries for Java, C# and Python. I am not a fan of php, so I don't know. But I know you should look at being an openid provider and the dependent websites must agree to be an openid dependent consumer.
精彩评论