Announcement Announcement Module
Collapse
No announcement yet.
Facebook Provider Sign-in Problem. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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) {
    SignInUtils.signin(account);
    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.

    Comment


    • #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.

      Comment


      • #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.

        Comment


        • #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

          Comment


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

            Comment

            Working...
            X