Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30

Thread: Spring Security + Spring Social + Filters

  1. #21
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Yes I'll make sure this is taken care of for M3. Thanks for the feedback, that's the kind of stuff we need.
    Keith Donald
    Core Spring Development Team

  2. #22
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Ok. I added a getUser() method to ProviderSignInAttempt exposing a ServiceProviderUser model. We can also consider adding more user fields to that model if there is demand.
    Keith Donald
    Core Spring Development Team

  3. #23
    Join Date
    Apr 2011
    Posts
    9

    Default

    Thanks

    I've noticed the function in the latest snaphot.

    Code:
    	/**
    	 * Get the profile of the provider user that attempted to sign-in.
    	 * Profile fields can be used to pre-populate a local user registration/signup form.
    	 */
    	public ServiceProviderUserProfile getUserProfile() {
    		return connection.fetchUserProfile();
    	}
    I would also love a getConnection()

    Finally, can I consider the snapshot API stable enough to migrate my code now ?

  4. #24
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Take a look at what's there now. I see what you mean about exposing the ServiceProviderConnection but take a look and let me know if the new ServiceProviderUserProfile meets your needs (see ProviderSignInUtils for easy access to it).

    The API is settling down, yes.
    Keith Donald
    Core Spring Development Team

  5. #25
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    I went ahead and made an update that allows the entire ServiceProviderConnection object to be accessed as you suggested. This is reflected in the latest snapshot available now. The Greenhouse reference app has also been updated to use this feature (you can see it there by cloning the code, running locally, and attempting to Sign in with Facebook).

    Keith
    Keith Donald
    Core Spring Development Team

  6. #26
    Join Date
    Apr 2011
    Posts
    9

    Default

    Great.

    The snaphot version I was using returned an empty profile but it seems you have fixed it today.

    public ServiceProviderUserProfile fetchUserProfile() {
    return new ServiceProviderUserProfile(null, null, null, null, null);
    }

    I've also noticed an SQL error (with MySQL) because of JdbcServiceProviderConnectionRepository.addConnect ion
    Here is the error messae details : 1093 - You can't specify target table 'ServiceProviderConnection' for update in FROM clause

    Since I'm using roo/JPA in my project I will implement a JPA based connection repository that will fix this issue for me.

  7. #27
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Shad,

    Any idea what's going on with that MySQL failure on addConnection? I turned MYSQL Compatibility mode on in our unit tests against H2 and they all pass. Wondering what's going on.

    Keith
    Keith Donald
    Core Spring Development Team

  8. #28
    Join Date
    Apr 2011
    Posts
    9

    Default

    Hi Keith,

    First of all, thanks for the code change. It works like a charm by using the new function
    Code:
    ProviderUserSignInUtils.getConnection(request).fetchUserProfile()
    ; in my SignupController (note that twitter does not give access to the email address)

    Here is the jdbc error details :

    org.springframework.jdbc.UncategorizedSQLException : PreparedStatementCallback; uncategorized SQLException for SQL [insert into ServiceProviderConnection (localUserId, providerId, providerUserId, rank, profileName, profileUrl, profilePictureUrl, accessToken, secret, refreshToken, expireTime) values (?, ?, ?, (select ifnull(max(rank) + 1, 1) from ServiceProviderConnection where localUserId = ? and providerId = ?), ?, ?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1093]; You can't specify target table 'ServiceProviderConnection' for update in FROM clause; nested exception is java.sql.SQLException: You can't specify target table 'ServiceProviderConnection' for update in FROM clause

    It seems that you can't use a subquery select on the insert target table.

    http://dev.mysql.com/doc/refman/5.0/...ry-errors.html

  9. #29
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Shad,
    Thanks for the information. I broke the subquery out into its own query and made the entire method @Transactional. Let me know if this works OK on MySQL (it should and our local tests pass).

    Thanks again,

    Keith
    Keith Donald
    Core Spring Development Team

  10. #30

    Default

    hi guys, can you please put all things together in a sample for sharing sake.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •