Grails oauth plugin is an awesome plugin, using this you can integrate your application with several sites that provide oauth support.

Following are the simple steps to integrate LinkedIn in you grails application:

Step 1 : Install the Oauth plugin

Open BuildConfig.groovy and add the following dependency inside plugins section :

Step 2 : Sign up as LinkedIn developer and create a new application

Go to the link and complete the application form. After successfully creating the app you got the API Key and Secret Key.

Step 3 : Add Config values in Config.groovy

Add following code in you Config file.

NOTE:- http://localhost:8080/grailsOauthPluginDemo is my server URL, replace it with yours.

Step 4 : Add linkedIn link in your sign up page

Add oauth:connect tag of oauth plugin tag library to create a link to LinkedIn.

<oauth:connect provider="linkedin">LinkedIn</oauth:connect>

Step 5 : Add handler for linkedIn response

Final step is to create action to handle the response returned by the LinkedIn after successful authentication.

You can get working code in the repository Grails Oauth Plugin Demo.