Facebook Provider Sign-in Problem.
Good day ,
I am having a small problem with my web app . I am trying to use spring social to provide a Facebook login feature for my app. I have a database with my local users accounts (PostgreSQL) and I'm using hibernate .
So far this is what i have accomplished. When a user comes to the sign in page , he/she can login using their username and password or click a <Sign-in with Facebook> button. When they click the button it posts to /signin/facebook and the ProviderSignInController kicks in and connects to Facebook , does the authentication and then sends the user to the signup page where it pre-fills some the fields (First Name , Last Name , email address) from the Facebook profile. they can then fill out the remaining fields and submit , where it saved to my database. I have a field in my database account table that stores the Facebook userid.
My problem is now , even after the account is created , when i click the <sign-in with Facebook> button , after it does the authorization by Facebook and redirects , it still doesn't make the link to the local user account , and prompts the user to sign up again .
I know where my problem lies , its a matter of how to fix it . I am trying to figure out how exactly the providersignincontroller tries to match the Facebook account to my local users account.
Any help will be greatly appreciated.
Thanks.
persistent storage of userConnections
hi , i solved the problem using the information you provided. Thank you very much . I understand where the users connection comes into play now. however one thing though . if i restart my server the user connections are lost. how can i save these connections to a table in my db ?