Given this hypothetical situation what would be a safe solution?
A large social netwokring (SN) site would like to provide developers with a login solution whereby the user can login directly from the developers site (as opposed to redirecting to the social networking site for authentication/ eg. OAuth), meaning there will be a login form on the developer's site where the user can provide their username and details used on the SN site.
Some of my ideas
The first solution I could think of is post details with an ajax request and a JSONP callback is given with information such as successfull login, error in username/password, or user information such as email address etc. This solution is riddled with issues the biggest being, can the SN site trust every developer? When the user logs in he could send an ajax request storing the users password in a database. Or the user may not even have JavaScript enabled (although ignore this last issue)!!
Alternatively, the SN site could provide an iframe where the user can login and it can call functions on the parent frame. The only security risk I could think of with this solution was if there are any xss vulnerabilties in the SN iframe src page however this is non-existant as the none of the page contains user submitted data.
I would never consider this in an application, I'de just like to extend my knowledge of what the capabilities are.