Multi-site user information how to synchronize, such as Baidu, glutinous rice, hao123, such a different domain name how do you do, come in a guaranteed 1 points

Source: Internet
Author: User
What I want to do now is to do a program, generic, modify the database link information, call 1 database, this is the backup
Use a (master), B (sub-station, such as glutinous rice) to indicate
A Station ID username pwd Email bduid
B Station ID username pwd Email bduid
Bduid represents a unique user identifier for the site,
If B station does not have this user, go to a to find,
If bduid in B is empty, insert the information into a
If B, and a in both, B in the bduid is empty, so I do not know how to deal with, if the email is the same good say, if not the same, compare some of the short ID must have a different person, AB 2 sites may have this account,
How did you deal with it?


Reply to discussion (solution)

Similar to the discuz of Ucenter, the user has a database (such as a), other applications (such as B), all from a to obtain user information, login/registration is performed by a A, a user table stored only in the B application of information

Similar to the discuz of Ucenter, the user has a database (such as a), other applications (such as B), all from a to obtain user information, login/registration is performed by a A, a user table stored only in the B application of information


My B table has some, user information, also to import in a table?
The UID in table B is also used in other tables in station B

The common user information exists in database A, and all of the application's UID is obtained from a

The common user information exists in database A, and all of the application's UID is obtained from a


Well, what if there was data in the B station before?
The other tables in station B have UID data that uses the user table,
I'm just going to have to do this now, everything else is similar,
Update password, you can set a URL, php background access, or direct server PHP file directly modify the password,
By the way, the previous password encryption method is not the same,


Only 100 points, not a plus.

If you now take the B station as the main, then the B station user data table as Ucenter, other C stations and the like, the user information is obtained from the B station, is the same

You seem to be doing an SSO (Single sign-on) system
1, due to the original system A, B, C, D ... already exists and works correctly. So SSO must be a standalone system
2, whether to use single sign-on, permissions in the user
3, because the original system user name and password are in existence, when the choice of single sign-on, the user should be listed in each system user name
can also register a new user, all-in-one system

Do not know what the landlord to do,
To synchronize the information of each website belongs to the same person, must have a unique mark, for example, e-mail address or mobile phone number or QQ number, if not, let the user provide a unique information that can be labeled users. Based on this unique information to re-build the table, the account of each site is organized into this table.

If the user information is updated, to have an interface to the various sites and your database to send messages, so that synchronization can be done.

If you now take the B station as the main, then the B station user data table as Ucenter, other C stations and the like, the user information is obtained from the B station, is the same



Oh, let me see, this can only solve a data, if there are 2, then I can't, I'll see

You seem to be doing an SSO (Single sign-on) system
1, due to the original system A, B, C, D ... already exists and works correctly. So SSO must be a standalone system
2, whether to use single sign-on, permissions in the user
3, because the original system user name and password are in existence, when the choice of single sign-on, the user should be listed in each system user name
can also register a new user, all-in-one system


Can you look at that?
Set a unified ID such as XXXXUID, to identify my users, a, B, etc. for the same user,
Unique user distinction is email or mobile
B Station registration, first send the user name, password, cell phone, mailbox, etc., uniquely identified to a station, registration, in B, save, Xxxuid and other information
Modify password Synchronization to update the user data for a,
This will not be a problem after the new
Previous old data processing
Because the password can not be obtained (MD5 encryption, AB password encryption method, is the same, the general Auth_key will be different),
B Station all the information through processing into a station, no password, return to the B station Xxxxuid identity This is the same user and write to the database,
If login, a station (password is empty, first import no password), go to B station to find the corresponding password, of course, PHP file has a configuration, field From_web_site content xxx.com
$auth _web_site=array ('  xxx.com ' =>array ('           url ' = ' B ' station URL, determine if the password is correct, return information?auth_key={auth_key}& Xxxuid= According to this query B station information ',            ' auth_key ' = ' to prevent from station verification '      //  If you add a website, so it is not afraid of, configuration, user data import under can be used, or//according to the return information update a station password, So you don't have to go to station B anymore,

You see this, there is no loophole, I thought for 2 days,
SSO this, Baidu, glutinous rice, it should be used this right? I just know this, see which is good, which is easier

Do not know what the landlord to do,
To synchronize the information of each website belongs to the same person, must have a unique mark, for example, e-mail address or mobile phone number or QQ number, if not, let the user provide a unique information that can be labeled users. Based on this unique information to re-build the table, the account of each site is organized into this table.

If the user information is updated, to have an interface to the various sites and your database to send messages, so that synchronization can be done.


Uniquely identified there, there are mailboxes, and phones, but usernames may be duplicated, but not through a mailbox or phone
Or the same mailbox, phone, user name is different, how do you deal with this?

With the Ucenter interface, you can be doing this recently.

With the Ucenter interface, you can be doing this recently.

Thanks, I'll check this out.

This multi-site is also a multi-platform user synchronization problem. Have done before ...
For example, there are a.b.c.d 4 sites. Separate running.
Now you want to unify ABCD, register, login user avatar points, and so much more information.

I was to take a site before the master site. That is, the master user database. Then other BCD register login need to use JSONP to query, register the primary site.
For example, b site login modification information.
Go and use Jsonp to notify the ACD site. This user is already logged in. The same is true for modifications.
The above method is relatively simple.
The best way to separate the communication system as the main system ... The following ABCD any information is requested by the main system: This design is better.

Ucenter can also. But the ideas are the same.

This multi-site is also a multi-platform user synchronization problem. Have done before ...
For example, there are a.b.c.d 4 sites. Separate running.
Now you want to unify ABCD, register, login user avatar points, and so much more information.

I was to take a site before the master site. That is, the master user database. Then other BCD register login need to use JSONP to query, register the primary site.
For example, b site login modification information.
Go and use Jsonp to notify the ACD site. This user is already logged in. The same is true for modifications.
The above method is relatively simple.
The best way to separate the communication system as the main system ... The following ABCD any information is requested by the main system: This design is better.

Ucenter can also. But the ideas are the same.



Well, we've decided to use Ucenter.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.