Red Squirrel
No Lifer
I'm writing a central authentication system to tie my forum, game server and other services so it uses one login. Basically same idea as a Google Account, I guess. This system will also house ACLs (Access Control List) which will entail being able to give users access to specific items. Like for the forum, all forum access will be done in this system instead of the forum. If I want to give a user access to a specific feature on any of my sites, same idea, I just drop them in the proper group in the authentication system.
Right now everything runs on the same server so it would be very easy to just have all the sites read/write to the same DB, but I want to make this future proof by making it so that each website just talks to the authentication system through a special URL. Basically it will POST info and get a result back. So when you login to the forum for example, your credentials are sent and then a yes/no is sent to say that you authenticated. A list of ACLs is then sent.
What is the best way of doing something like this? Most programs will be using php, but some of them may be other languages. I'm thinking of just using HTTPS for everything, so in php I could probably juse use cURL to POST data. This would be done over HTTPS, as stuff like logging in or verifying a session cookie would be done in "clear text". (HTTPS would encrypt it but the web page at the other end would see it as clear text so it can process it properly).
is cURL the way to go for this type of cross site communication or is there a better way? Of course, I will also want to implement proper security so that a random joe who happens to find that administrative URL can't just submit commands to it. So there will probably be some kind of passcode or something, and IP access list as well.
Any performance issues I should also be worried about to doing this? Debating on if I want the authentication/session checks to be real time or if sites will just cache it so each page load does not also involve a hit to the authentication server.
Eventually I would probably get a small VPS or something for the authentication server as I figure if it's running JUST that, and SSH for administration, there is less attack surface for the user database to get hacked etc. Of course the passwords will be salted and peppered with bycrypt so have fun with that even if it does get compromised. 😛
Right now everything runs on the same server so it would be very easy to just have all the sites read/write to the same DB, but I want to make this future proof by making it so that each website just talks to the authentication system through a special URL. Basically it will POST info and get a result back. So when you login to the forum for example, your credentials are sent and then a yes/no is sent to say that you authenticated. A list of ACLs is then sent.
What is the best way of doing something like this? Most programs will be using php, but some of them may be other languages. I'm thinking of just using HTTPS for everything, so in php I could probably juse use cURL to POST data. This would be done over HTTPS, as stuff like logging in or verifying a session cookie would be done in "clear text". (HTTPS would encrypt it but the web page at the other end would see it as clear text so it can process it properly).
is cURL the way to go for this type of cross site communication or is there a better way? Of course, I will also want to implement proper security so that a random joe who happens to find that administrative URL can't just submit commands to it. So there will probably be some kind of passcode or something, and IP access list as well.
Any performance issues I should also be worried about to doing this? Debating on if I want the authentication/session checks to be real time or if sites will just cache it so each page load does not also involve a hit to the authentication server.
Eventually I would probably get a small VPS or something for the authentication server as I figure if it's running JUST that, and SSH for administration, there is less attack surface for the user database to get hacked etc. Of course the passwords will be salted and peppered with bycrypt so have fun with that even if it does get compromised. 😛