When I was adding the login in FB into my Spring MVC application, I found out, that Spring forced me to create two additional tables (user_connection
and user_profile
).
More info about it this SO question and here.
Despite the fact that the social login works fine in my application, I'm a bit confused why this two table that I was forced to create are empty?
My question is in this case, what's the goal of having these two tables and how can I populate the content of them?
Inserting and updating of the USERCONNECTION table are carried out by the JdbcUsersConnectionRepository of Spring Social Security API.
After users login with social network, you have UserProfile created, the UserProfile is a object for storing the users' basic information and social network information.userID corresponding to the UserProfile can be found in USERCONNECTION table which and find records related to User_Accounts corresponding to userID. If there is no corresponding record in USER_ACCOUNTS table, it will redirect to the signup page.
After signing up, an USER_ACCOUNTS record is created while an USERCONNECTION record is also created and thereon login to website happens automatically.
If the system can find out USERCONNECTION record that corresponds to UserProfile, a User_Accounts record will be created, and create a USERCONNECTION record.
After users logging in with social network, if the users' information do not already exist in the Database of application, it will be automatically created or redirected to a page allowing the users to enter account information. In case you want to automatically create USER_ACCOUNTS & USERCONNECTION records, you must write class in order to implement interface ConnectionSignUp.
Please refer below
Social Login in Spring MVC with Spring Social Security
see section
7- Classes for SignUp