spring-social

Attach OAuth2 login to existing users in a Spring Boot application

独自空忆成欢 提交于 2019-12-22 01:17:41
问题 I have a Spring Boot application that is "invitation only". Ie. users are sent a signup link and there is no "Sign up" functionality. This works fine and users log on with their username and password. I would like to allow logon with FaceBook and Google using OAuth2 as a supplementary logon method. This would involve mapping the existing users to their social account in some way. The users and their passwords are stored in a MySQL database. I have found a number of articles on OAuth2 and

Integrate Spring Security with Facebook Login

做~自己de王妃 提交于 2019-12-21 05:22:07
问题 I use Spring MVC and Spring Security for my project.. This using my own user data for authentication. But now i trying to integrate with Facebook. i have created app on Facebook means i got Client ID and client Secret.. I also read some questions in SO and some documents but still stuck... i create controller to Login with Facebook : import java.util.List; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation

Superclass has no null constructors but no arguments were given

痞子三分冷 提交于 2019-12-20 11:04:40
问题 Im using Spring Social in my application: <spring.framework.version>3.2.0.RELEASE</spring.framework.version> <hibernate.version>4.1.9.Final</hibernate.version> <commons-dbcp.version>1.4</commons-dbcp.version> <org.springframework.social-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social-version> <org.springframework.social.facebook-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social.facebook-version> <org.springframework-version>3.2.1.RELEASE</org.springframework-version> <org

What is the difference between spring factory-method and factory-bean?

情到浓时终转凉″ 提交于 2019-12-20 10:21:10
问题 I am new Springs. In Bean tag I found factory-method and factory-bean Attributes. What is the difference between factory-method and factory-bean? I am using factory-method to call my getInstance static method to create singleton object. What is factory-bean used for? For given replies, What I understood was Factory-method is used for calling a static method to create object in same bean class. Factory-bean is used for creating a object based on factory design pattern. Ex:- I am asking a

Facebook Login with Spring Social using Existing User Access Token

青春壹個敷衍的年華 提交于 2019-12-20 09:18:26
问题 Here's what I currently have: Spring REST service where many of the APIs require the user to be authenticated A 'registration' API (/api/v1/register) A 'login' API that takes username/password (/api/v1/login) 'Facebook Login' API that relies on Spring Social and Spring Security to create a User Connection and log my user in (/auth/facebook) My problem is that I want these APIs to be used by multiple clients, but the way Facebook Login is right now, it doesn't work well on mobile (works great

Spring Social Facebook: “The OAuth2 'state' parameter doesn't match”

别来无恙 提交于 2019-12-19 05:08:31
问题 I am using Spring Social Facebook within a Spring MVC project to support Facebook login. This is working well in almost all cases, but occasionally I see the following exception in the logs. ERROR org.springframework.social.connect.web.ProviderSignInController - Exception while completing OAuth 2 connection: java.lang.IllegalStateException: The OAuth2 'state' parameter doesn't match. at org.springframework.social.connect.web.ConnectSupport.verifyStateParameter(ConnectSupport.java:173) at org

Own Spring OAuth2 server together with 3rdparty OAuth providers

纵然是瞬间 提交于 2019-12-17 22:33:50
问题 In a Spring Boot application, I have an OAuth2 Authorization/Resource servers. Based on this and Spring Security, I have secured my Spring MVC REST API endpoints. In addition to this, I'd like to add authentication to my REST endpoints based on 3rd party OAuth providers like Twitter, Facebook, Google. In my application I have two entities - User and SocialUser . SocialUser represents user profile in social networks. User can have 0-* associated SocialUsers . Right now I can authenticate a

Linkedin “Scope” Variable not set

試著忘記壹切 提交于 2019-12-13 16:06:38
问题 I'm having trouble setting up a connection to Linkedin Api using Spring Social. I am passing the "scope" variable "r_emailaddress" as a hidden field with the form to retrieve the email address but it's not working - I don't see the email_address permission like you do here. https://developer.linkedin.com/sites/default/files/gp-dialog.png I am following the Spring Social Showcase Application Example. I should add, the Social Application there is no hidden scope field. It works fine with

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

spring social get user email while authenticate

点点圈 提交于 2019-12-12 20:44:59
问题 We are using spring-social to integrate our application to facebook. In OAuth2AuthenticationService, scope is empty. We set scope as a input on form.But it was not work and scope could not be set . We could not get user email. Are there any way to override "OAuth2AuthenticationService" scope variable ? Not: Spring social verison is 1.1.0.BUILD-SNAPSHOT We used spring social sample which contains security xml version <form name="fb_signin" id="fb_signin" action="../auth/facebook" method="post"