I have my site 'A'. I will have a business contract with site 'B' to enable users of site 'B' (there will be many such sites) to redirect their users to my site when the users do one of many 'A' related actions on 'B'. I can mandate passing of whatever information from 'B' to 'A' directly or through the browser of the user of 'B', but I (ie site A) NEED to validate that they indeed came from 'B' and automatically log them in into site 'A'.
I KNOW that OAuth does this well - but ONLY at the "user" level. What's happening here is a business contract between site A and site B - and there is no need of inconveniencing every user of 'B' to do the whole OAuth hoop-jumping...
Please also note that site 'B' users will be presented with a FORM that they need to click on for those actions to be transmitted to my site 'A'. Whatever secret / authentication data (if any) is being communicated to the 'B' user can be seen (and tampered) by them. My site 'A' has to protect against that.
This is close: Securely Transferring Users Between Web Sites .
Options listed there:
- Write a web-service call over HTTPS, at both ends, to retrieve the users details, and that only works for a specific login-pair.
- Take a look at "Pass-through Authentication," its a concept that allows a user's identity to be passed from one system to another.
- The best thing I can think of right now is passing a HASH of the user ID, or if that makes you worry, the hash of some other user data.
- Site B could have a web-service that allows Site A to create a session for the user.
But I'm wondering if ppl have different opinions since the Q was asked a year and a half back.
My questions:
- How should i implement this?
- Any readymade php implementations which enable this?
[I've already implemented something like this which turned out to be a flawed mechanism, so I'm curious what the correct mechanism would be.]