views:

28

answers:

1

Is it possible to let an user login to multiple websites from my website using javascript?

+1  A: 

Short Answer: Not with Javascript

Long Answer: With a server side language such as PHP, this could be possible depending on whether or not the websites that you want to remotely log into allow for such behavior. I'm not sure exactly what you want to do, but for things such as accessing personal information from the accounts on those other sites, then yes, this is entirely possible. If you own the other sites, you can do it much more easily because you already know how those sites function, instead of learning the 3rd party website's API.

EDIT: I guess I completely forgot about AJAX, this could be done with AJAX, but obviously that works alongside a server-side language.

Ben
I was thinking about letting the user log in to my site and from my site they can click on facebook, twitter etc and I will redirect them there but they will reach the website logged in (they have already entered the password to the other accounts in my website). You think this is possible even though the websites don't have API for logging in? To be clear, I only redirect them to the other sites logged in, I don't want to create a mashup with the API:s.
never_had_a_name
Well, this is possible with facebook and twitter, but you have to do it through there authentication system. I have not personally done this but their API allows for the user to securely log in, but they must tell the network that your site has permission to act under their account, I'm sure you've seen this if you have used an application that integrates with Twitter. In short, this is not really feasible, it is more trouble than its worth and would likely result in a poor user experience. Good idea though, social networks are just too secure for that sort of thing.
Ben
@Ben: If I log in through their API and then redirect my user there. Do you think they will land on the logged in page?
never_had_a_name
Yes, they will.
Ben