Announcement Announcement Module
No announcement yet.
Facebook Provider Sign-in Problem. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Problem Solved !

    Your were exactly correct. I was taking for granted that authentication.getName() was returning the email address.

    In my system , the user's email address is what i use in my userconnection table as seen here :

    if (account != null) {
    ProviderSignInUtils.handlePostSignUp(account.getEm ail(), request);
    return "redirect:/";

    Therefore the the authentication.getName() was not returning my username in my table i.e. the user's email address .

    So i modified the createConnectionRepository method to suit my system. I have a method that can get an account object for the currently authenticated user. So i call the method and get the user's email address from the object , and use this email address to create the connectionrepository as seen below :

    Account account = AccountUtils.getCurrentAccount();
    String myAuth = authentication.getName();
    if (account !=null) {
    myAuth = account.getEmail();

    return usersConnectionRepository().createConnectionReposi tory(myAuth);

    Thank you very much for your help.


    • #17
      I'm glad you sorted it out. I wasn't sure where to head to if that didn't work.

      To be clear: You say you changed the createConnectionRepository() method, but would it be more correct to say that you changed the configuration for connectionRepository() to call createConnectionRepository() with the right value? Just want to be sure that you didn't actually change JdbcUsersConnectionRepository's createConnectionRepository() method, as that would be completely unnecessary.


      • #18
        yeah thats what i mean. i didn't actually change the method. just the value that it uses when i call it.

        Thanks again.


        • #19
          Originally posted by habuma View Post
          With Spring Social Showcase, it's using an in-memory database, which is great for demos and development, but horrible for production for the reasons you've just given. I'm assuming that the reason your connections are lost is because you're using the embedded database. Rather than use the embedded database, you should use a datasource that's tied to a real DB.
          Originally posted by modeminho View Post
          Thank you Craig , I got it working by creating the userconnection table in my db and pointing the datasource to it. Everything works fine now. The only thing i noticed when i created the table is that i had to change refreshtoken and secret fields from not null to allow nulls because this was throwing an error.

          Thanks again for your help.
          I have spring social showcase example here with in-memory database, so how to configure it so I can connect with table member in my DB?, I already make table connection in my member DB


          • #20
            ardiavernus: I've already answered your question in a separate thread. Let's not continue the discussion in this thread.