OK, here's the run-down:
I have a site that is open to registered users only. Users are registered by their parent company. I have set up my authentication so:
The user logs in with email address and userID (unique to the user); my page checks tbl_users for a row that contains both values, and returns results. I count the results, and if it is greater than zero, they are authenticated and allowed to proceed. Very easy, and because I know the userID is unique, effective.
Well, now the parent comapny wants to integrate the site into their intranet, essentially linking to my external site from the intranet. However, they want me to allow them to bypass my login screen. To do this, they will send a variable via post as part of their link. It will contain one value called auth - that value contains BOTH the email address and the userID like this "UserID,emailaddress" (eg "BOBBY01,bobby@yourcompany.com"
So it's one value with two values in it, seperated by a comma. If the user on their intranet is not a company employee (like a consultant or something), the value for UserId will be -2.
Additionally, they will be referring from one of two domains - I will need to check the referring URL to ensure it is either my login screen, or one of these two URLs , and to deny access otherwise.
I think I can make all of this work, but I just want someone to check my logic before I get deeply involved in doing the wrong things.
Here's what I think I need to be doing:
First: I need to check the referring URL to make sure it's cool. If it is, go to step 2, if not, they can get bent.
Second: If the referring URL was my login page, the $pwd and $username should be set (checking with isset), and I can proceed normally. If the referring URL was one of their two pages, I need to proceed to a parsing process on auth, and to unset $pwd and $username.
Third, part A: referred from my login page, $pwd and $username are compared to the db, rows returned and counted, if greater then zero, rock on.
part B: if referred from other two URLs, I need to (extract? parse?) auth into two parts and set the values of $pwd and $username accordingly. I do not yet know how to do this, but I will RTFM and try to find out. I will then use my query with these values for $pwd and $username and count returned orws, and if greater than zero, rock on.
I think that's all I need to do. There is no user-driven registration process; registered users are notified of their registration by the home office,a nd access to the link is restricted to these people. Any non-employee who clicks the link will send and unrecognized userID (-2) and will be denied. I am thinking it does not matter that the value is -2 - just that it doesn't match anything in the db.
Anyone see any problems with my logic, have panual pages I should read, or suggestions on alternative ways to address the problem? I have to be live 10/7, so I've got plenty of time. . .
Tahnks folks,
Regards, and TIA,
Nedstar1
I have a site that is open to registered users only. Users are registered by their parent company. I have set up my authentication so:
The user logs in with email address and userID (unique to the user); my page checks tbl_users for a row that contains both values, and returns results. I count the results, and if it is greater than zero, they are authenticated and allowed to proceed. Very easy, and because I know the userID is unique, effective.
Well, now the parent comapny wants to integrate the site into their intranet, essentially linking to my external site from the intranet. However, they want me to allow them to bypass my login screen. To do this, they will send a variable via post as part of their link. It will contain one value called auth - that value contains BOTH the email address and the userID like this "UserID,emailaddress" (eg "BOBBY01,bobby@yourcompany.com"
So it's one value with two values in it, seperated by a comma. If the user on their intranet is not a company employee (like a consultant or something), the value for UserId will be -2.
Additionally, they will be referring from one of two domains - I will need to check the referring URL to ensure it is either my login screen, or one of these two URLs , and to deny access otherwise.
I think I can make all of this work, but I just want someone to check my logic before I get deeply involved in doing the wrong things.
Here's what I think I need to be doing:
First: I need to check the referring URL to make sure it's cool. If it is, go to step 2, if not, they can get bent.
Second: If the referring URL was my login page, the $pwd and $username should be set (checking with isset), and I can proceed normally. If the referring URL was one of their two pages, I need to proceed to a parsing process on auth, and to unset $pwd and $username.
Third, part A: referred from my login page, $pwd and $username are compared to the db, rows returned and counted, if greater then zero, rock on.
part B: if referred from other two URLs, I need to (extract? parse?) auth into two parts and set the values of $pwd and $username accordingly. I do not yet know how to do this, but I will RTFM and try to find out. I will then use my query with these values for $pwd and $username and count returned orws, and if greater than zero, rock on.
I think that's all I need to do. There is no user-driven registration process; registered users are notified of their registration by the home office,a nd access to the link is restricted to these people. Any non-employee who clicks the link will send and unrecognized userID (-2) and will be denied. I am thinking it does not matter that the value is -2 - just that it doesn't match anything in the db.
Anyone see any problems with my logic, have panual pages I should read, or suggestions on alternative ways to address the problem? I have to be live 10/7, so I've got plenty of time. . .
Tahnks folks,
Regards, and TIA,
Nedstar1