LinkedIn actually provides 2 APIs:

1. Initialize your linkedin api key and secret key

Linked in api key can be obtained from

2. Setting your callback:

callback_url = ‘http://localhost:3000/linkedin_callback’

3. Create oauth object

oauth =, linkedin_secret)

4. Request authorize url


=> “″

Open the link in your browser as redirection url for user to do authorization process, if user authorize it we will get params[:oauth_verifier] in our “callback_url”, use it to authorize from request.

for example:


oauth_verifier = “00883″

authorize using oauth verifier and token

oauth.authorize_from_request(oauth.request_token.token, oauth.request_token.secret, oauth_verifier)

create linkedin api object

linkedin =

For any rails development & consulting services Hire rails developer from RailsCarma

Leave a Reply

Your email address will not be published.