spring-social

Spring Boot and OAuth2 social login, unable to get refreshToken

时光总嘲笑我的痴心妄想 提交于 2019-12-01 12:28:04
问题 There is a guide how to implement OAuth2 using Spring and Spring Boot https://spring.io/guides/tutorials/spring-boot-oauth2/ I need to store OAuth2 information like accessToken, refreshToken in my database for future use. Right now I can only get accessToken. I can't figure out how to get refreshToken based on this guide. What is the proper way to get refreshToken using approach described in this guide ? UPDATED I have an access to refreshToken in OAuth2ClientAuthenticationProcessingFilter

No Spring Security Remember me cookie created when logging in programmatically

徘徊边缘 提交于 2019-12-01 06:55:36
Right after registration (sign up) I'm logging in my user programmatically via Spring Security: public register(HttpServletRequest request, String user, String password) { ... request.login(user, password); } This works fine, but it doesn't create the remember-me cookie (although with interactive login the cookie is created fine). Now I've read in this and this answer, that you have to wire in the implementation of RememberMeServices (I use PersistentTokenBasedRememberMeServices ) and then call onLoginSuccess . I haven't been successful to autowire PersistentTokenBasedRememberMeServices . How

No Spring Security Remember me cookie created when logging in programmatically

倖福魔咒の 提交于 2019-12-01 03:23:26
问题 Right after registration (sign up) I'm logging in my user programmatically via Spring Security: public register(HttpServletRequest request, String user, String password) { ... request.login(user, password); } This works fine, but it doesn't create the remember-me cookie (although with interactive login the cookie is created fine). Now I've read in this and this answer, that you have to wire in the implementation of RememberMeServices (I use PersistentTokenBasedRememberMeServices ) and then

How to set redirect url after success login using Social Providers

 ̄綄美尐妖づ 提交于 2019-11-30 21:35:51
I need change the redirect url when my user is succefull logged in using some of Spring Social Providers, like Twitter in this case. I'm getting in every set***Url("") a null pointer exception Some times setting this don't work too I tried so far setting: public ProviderSignInController signInController(ConnectionFactoryLocator connectionFactoryLocator, UsersConnectionRepository usersConnectionRepository) { ProviderSignInController providerSignInController = new ProviderSignInController(connectionFactoryLocator, usersConnectionRepository, new CSignInAdapter(requestCache()));

How to set redirect url after success login using Social Providers

混江龙づ霸主 提交于 2019-11-30 05:27:03
问题 I need change the redirect url when my user is succefull logged in using some of Spring Social Providers, like Twitter in this case. I'm getting in every set***Url("") a null pointer exception Some times setting this don't work too I tried so far setting: public ProviderSignInController signInController(ConnectionFactoryLocator connectionFactoryLocator, UsersConnectionRepository usersConnectionRepository) { ProviderSignInController providerSignInController = new ProviderSignInController

EnableOAuth2Sso simultaneously for multiple social networks

五迷三道 提交于 2019-11-29 15:48:27
I am implementing a spring boot application that needs to provide OAuth2 token authorization and support multiple social services (google+, facebook etc). The user should be able to select his preferred social network and sign-in using the OAuth2 authorization framework. I am implementing the above using the approach described here http://cloud.spring.io/spring-cloud-security/ . Currently my application.yml looks like this spring: oauth2: client: clientId: {{my app's google id} clientSecret: {{my app's google secret code}} etc... Also, the spring boot main class is annotated as

Rest, Spring own OAuth2 server + OAuth2 providers like Facebook, Google, Yahoo

倖福魔咒の 提交于 2019-11-29 09:25:27
问题 In Spring Boot application I have secured my Spring MVC REST endpoints with Spring Security and Spring OAuth2. I have own Authorization\Resource servers so in order to comunicate with our API, client(AngularJS) needs to obtain acessToken from my API Authorization Server. Everything works fine but for authentication/authorization on my API, user needs to create his account and provide us with his username/password. I'd like to simplify this process and would like to propose user to

What could cause the original 'OAuth2' state parameter to be null in org.springframework.social.connect.web.ConnectSupport?

限于喜欢 提交于 2019-11-28 13:28:37
I am trying to use Spring Social on my application and I noticed while debugging that the original 'OAuth2' state parameter is always null on my app. See Spring Social source code for org.springframework.social.connect.web.ConnectSupport below: private void verifyStateParameter(NativeWebRequest request) { String state = request.getParameter("state"); String originalState = extractCachedOAuth2State(request);//Always null... if (state == null || !state.equals(originalState)) { throw new IllegalStateException("The OAuth2 'state' parameter is missing or doesn't match."); } } private String

Spring Boot Hibernate 5 Ignoring @Table and @Column

徘徊边缘 提交于 2019-11-28 13:28:19
This is driving me mad. I'm implementing Spring Social and it requires you to have a database table named UserConnection (instead of using the standard naming convention of using an underscore to separate the two words). So in my naive world view, I assumed it would be easily solved by specifying @Table(name="UserConnection") ... but no, that would be all too easy. The annotation is ignored and the table is created as user_connection which then causes Spring Social to have a hissy fit. Please tell me there's some easy way to tell my Spring Boot app to just name that one table (and its

What has happened with the class org.springframework.social.connect.ConnectionRepository in Spring Social 3.0.0.M1?

杀马特。学长 韩版系。学妹 提交于 2019-11-28 09:25:00
问题 I am a beginner with the Spring Framework and wanted to try out Spring Social to make a simple web application which retrieves data from Facebook. For this I followed Spring Socials official " Getting started guide " called " Accessing Facebook Data ". The first problem I encountered was that the Spring Social version 2.0.3.RELEASE , which seems to be the latest official version of Spring Social, does not support version 2.8 of the facebook API (and therefore gives me the following error: " (