Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8800547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:37:08+00:00 2026-06-14T00:37:08+00:00

is it possible to post in linkedin through ruby on rails application. If so

  • 0

is it possible to post in linkedin through ruby on rails application. If so kindly guide me how to go for it.

I googled a lot but didnt get any correct solution that works.

My Code is as follows.

for controller,

require 'rubygems'
require 'linkedin'
class AuthController < ApplicationController

def index
 LinkedIn.configure do |config|
  config.token = "somekey"
  config.secret = "somesecret"
end

LINKEDIN_CONFIGURATION = { :site => 'https://api.linkedin.com',
                    :authorize_path => '/uas/oauth/authenticate',
                    :request_token_path =>'/uas/oauth/requestToken?scope=r_basicprofile+r_emailaddress+r_network+r_contactinfo',
                    :access_token_path => '/uas/oauth/accessToken' }
client = LinkedIn::Client.new("some_key", "some_secret",  LINKEDIN_CONFIGURATION )
request_token = client.request_token(:oauth_callback => 
                              "http://#{request.host_with_port}/auth/callback")
session[:rtoken] = request_token.token # request token
session[:rsecret] = request_token.secret # request secret
redirect_to client.request_token.authorize_url
end

def create
   @user = User.find_or_create_from_auth_hash(auth_hash)
   self.current_user = @user
   redirect_to '/'
end

 protected
  def auth_hash
   request.env['omniauth.auth']
  end

def callback
 if session[:atoken].nil?
  pin = params[:oauth_verifier]
  atoken, asecret = client.authorize_from_request(session[:rtoken], session[:rsecret], pin)
  session[:atoken] = atoken # authentication token
  session[:asecret] = asecret # authentication secret
 else
  client.authorize_from_access(session[:atoken], session[:asecret])
 end
 @profile = client.profile(:fields => [:first_name]).first_name
 @profiles = client.profile(:fields => [:last_name]).last_name  
 @positions = client.profile(:fields => %w(positions)).positions
 @headline = client.profile(:fields => [:headline]).headline
 @educations = client.profile(:fields => [:educations]).educations
 @post = client.add_share({:comment => "blah"})
@user = client.profile(:fields => %w(positions))
@companies = @user.positions.all.map{|t| t.company}
# And if you want the most recent company it can be accessed via companies[0]
 end
end

config/initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
provider :linkedin, "some_key", "some_secret", :scope => 'r_fullprofile  r_emailaddress r_network', :fields => ["id", "email-address", "first-name", "last-name", "headline", "industry", "picture-url", "public-profile-url", "location", "connections"]
end

in views,

Headline : <%= @headline %>
</br>
Name : <%= @profile %> <%= @profiles %>
<%= @positions %>
<%= @post %>
<%= @user %>
<%= @educations %>
<%= @companies %>
</br>
<br/>
WELCOME !!!
You have successfully logged in to  through Your LinkedIn Profile !!!
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:37:10+00:00Added an answer on June 14, 2026 at 12:37 am

    What do you mean by post? What exactly are you trying to post? I’m assuming you’re looking to post network updates from your application. In that case, you’ll need to grant your app “rw_nus” permissions. Just tack that member permission to your :request_token_path

    :request_token_path =>'/uas/oauth/requestToken?scope=r_basicprofile+r_emailaddress+r_network+r_contactinfo+rw_nus'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One possible solution could be simple HTTP get or post request, but that wouldn't
Possible Duplicate: how to get GET and POST variables with JQuery? I have the
Possible Duplicate: PHP detecting request type (GET, POST, PUT or DELETE) This should be
I want to post a blog on linkedIn so how it's possible?I have completed
This may be a very basic question, but is it possible to post a
Possible Duplicate: Post order traversal of binary tree without recursion I was going through
Sql Injection is possible if parameters are passed via GET. But is it possible
Is it possible to post data from an asp.net application in one domain to
I have three possible HTTP Post returns that I'm trying to get an Array
I am wondering if it is possible to post through a Facebook app to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.