How to do rest authentication with Spring Social?

SpringSpring SecuritySpring SocialSpring Security-Oauth2

Spring Problem Overview


I have implemented Spring Social + Spring Security as outlined in the Spring security examples (and with spring security java config). I reported couple of problems at the time (see https://jira.springsource.org/browse/SEC-2204) all of those are resolved and my security works fine.

However, I want to change my security implementation and use RESTful authentication. Spring oauth/oauth2 (http://projects.spring.io/spring-security-oauth/) solves this problem but I can not see how Spring Social will fit into that picture? Although behind the scenes Spring social talks to Facebook/Twitter with oauth, I don't think Spring Social's signup form and other characteristics are built for a restful API.

Any examples or ideas will definitely help.

Update on this post: (4/6/2014)

  • I have built a (PHP) site that consumes my API.
  • This PHP site (let's call it the client site), uses Facebook PHP SDK to register its own users. This is a completely separate way of gathering its own members.
  • However, once users are registered client site passes username, email, password, first name, and last name data along with its client_id and client secret and using OAuth2 grant type client_credentials authentication.
  • This passed-in user data creates an user record on the main system! (main application)
  • After this, each time the client site calls the main system via OAuth2 grant type password and sends client_id, client_secret, username and password, gets an "Authentication token" and be able to communicate with the main site with this token.

Seems like a long way to go but solves the problem of keeping the user record on the main system. I'm curious if there are other ways to do this? Please advise.

Spring Solutions


Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionaug70coView Question on Stackoverflow