Authenticating with a third-party OAuth2 scheme

This recipe uses the Spring social project in order to use the OAuth2 protocol from a client perspective.

Getting ready

We won't create an OAuth2 Authentication Server (AS) here. We will establish connections to third-party Authentication servers (Yahoo!) to authenticate on our application. Our application will be acting as a Service Provider (SP).

We will use Spring social whose first role is to manage social connections transparently and to provide a facade to invoke the provider APIs (Yahoo! Finance) using Java objects.

How to do it...

  1. Two Maven dependencies have been added for Spring social:
     <!– Spring Social Core –> <dependency> <groupId></groupId> <artifactId>spring-social-core</artifactId> ...

Get Spring MVC Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.