Question

I have this situation where user login via facebook needs to check on the $_SERVER['HostName'] as in the database user table that keep records of particular user details might have more than one row. The difference is by the "hostname" (to differentiate which subdomain from).

In this situation I can login user with facebook without checking hostname when it comes to hostname I don't know where should I integrate the check of "hostname".

Any details that is needed to help understand the situation? I have been looking around for 2 days and no luck on the solution :/

Facebook plugin from here

Was it helpful?

Solution

I'm not really sure how you're using the hostname for the users, but I think you can use the scope setting to add the condition you're looking for:

'SocialSignIn.Facebook' => array(
    ...
    'scope' => array('User.hostname' => $_SERVER['SERVER_NAME']), // or $_SERVER['SERVER_ADDR']
    ...
)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top