I have a site (A) for main project with user system (which is supposed to display all student competitions and academic events in my country for registred users. The site is also enabling users to sign them to these events and some other things. The A account includes just basic information as name, school, email, field of interest, ...)
Also I'm building a site (B) as "subproject" (for finding part-time jobs and collaboration with bigger organizations in subject field. Also, there are going to be more of similiar future subprojects, so (B) represent a set of child sites). The B sites requires the same data as in A and a few more to be filled in. All subproject will be maintained by the same group of people as the one from main project.
I thought that it would be nice to enable users to login to B sites with account from A but also make it possible to register to B with individual account because users don't have to generally come only from the main A site and may be only interested only in B.
Both servers are running PHP and MySQL service. The B sites will not be hosted on the same server as A so they will have to communicate through Internet, obviously.
I planned following scenario, so far:
- User logs in to B with credentials from A
- B hashes password and send it with user name through secured channel to A
- A compares user and hashed password with its database and either send message with error back or
- B logs user in
But my main problem is the part with secure communication, I've looked up some of the basics like that the servers would need a certificate to recognize each other but I haven't found any concrete piece of code to start with.
Also there is a problem with storing the user data, because B needs to be able to show certain field on public website, it would be nonsence to look for them on remote DB, I think. But that leads to storing A user profile fields on B server, so it would be useless to do the whole thing anyway.
I would appreciate any advice!