Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for the right way: Spring Social + Spring RESTful API + Spring WebApp + Mobile Clients

I have a RESTful API built with Spring 3.1, using Spring Security as well. I have a web application, also a Spring 3.1 MVC application. I am planning to have mobile clients accessing my REST API. So my API is the central place to authenticate, get data served from, etc.. It all makes sense so far.

Now what I cannot wrap my head around is how to add Spring Social in an easy and smart way. How did you do it? Did you maybe only move the ConnectionRepository to the API? Or did you have the API do it all? I want to prevent double-authorization for each client-technology by all means (preventing double-authorization meaning userA connects to facebook in the webapp, and then starts using our mobile client and should NOT be asked to connect to facebook again just b/c userA is using a different client).

Thanks for sharing your thoughts!

like image 932
pumuckl Avatar asked May 07 '13 01:05

pumuckl


People also ask

How do I create a RESTful web service using Spring?

React + Spring Boot Microservices and Spring Note − For building a RESTful Web Services, we need to add the Spring Boot Starter Web dependency into the build configuration file. If you are a Gradle user, use the following code to add the below dependency in your build. gradle file.

What is spring RESTful?

Spring REST Docs helps you to document RESTful services. It combines hand-written documentation written with Asciidoctor and auto-generated snippets produced with Spring MVC Test. This approach frees you from the limitations of the documentation produced by tools like Swagger.

What is RESTful API?

RESTful API is an interface that two computer systems use to exchange information securely over the internet. Most business applications have to communicate with other internal and third-party applications to perform various tasks.


1 Answers

The solution we use it to secure our rest-webservices using spring security, with a cookie based remember me service. This uses well documented traditional spring-security techniques.

We then plugged in spring-social to our system, which then simply logs in the user as normal using spring secruity. The social api looks up the, for example, facebook id in your db table, if it finds existing connection logs the user in using their account on your system (and can redirect to sign up page etc).

I suggest breaking down the question into more specific areas.

like image 65
NimChimpsky Avatar answered Oct 06 '22 19:10

NimChimpsky