Yes I'll make sure this is taken care of for M3. Thanks for the feedback, that's the kind of stuff we need.
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
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
Thanks
I've noticed the function in the latest snaphot.
I would also love a getConnection()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(); }
Finally, can I consider the snapshot API stable enough to migrate my code now ?
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
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
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.
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
Hi Keith,
First of all, thanks for the code change. It works like a charm by using the new function; in my SignupController (note that twitter does not give access to the email address)Code:ProviderUserSignInUtils.getConnection(request).fetchUserProfile()
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
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
hi guys, can you please put all things together in a sample for sharing sake.