spring-social-google

How to get providerUserId by providerId, accessToken and secret? (Spring Social)

纵然是瞬间 提交于 2019-12-13 07:27:35
问题 In my application I can identify user by providerId and providerUserId. But initially, I have only following information: providerId, accessToken, secret. Thus, I need to acquire providerUserId by this information. I'm trying to use following code: ConnectionData connectionData = newConnectionData(providerId, accessToken, secret); ConnectionFactory<?> connectionFactory = connectionFactoryLocator.getConnectionFactory(providerId); Connection<?> connection = connectionFactory.createConnection

How to recover from a Spring Social ExpiredAuthorizationException

别说谁变了你拦得住时间么 提交于 2019-12-11 01:34:46
问题 I am trying to implement Google Oauth2 with Spring Social and spring-social-google. Initial authentication works fine. However after some time the authentication expires and I am hit by org.springframework.social.ExpiredAuthorizationException: The authorization has expired. How can you recover from this exception? Is it possible to somehow refresh the authorization? 回答1: Try to send additional access_type=offline paramter during authorization. It may looks something like this: <form ...> ....

Spring Security - Default Tables not created

孤街醉人 提交于 2019-12-06 06:48:51
问题 I'am trying to integrate Spring Social on top of Spring Security in a Spring Boot application. But it seems like Spring Security is having issues creating the default tables, e.g. UserConnection, UserProfile, etc since I get these SQL errors after the connection to an oauth2 provider was successfully established: PreparedStatementCallback; bad SQL grammar [select userId from UserConnection where providerId = ? and providerUserId = ?]; nested exception is org.h2.jdbc.JdbcSQLException: Tabelle