开发者

Omniauth with Linkedin in Rails to Post Updates

开发者 https://www.devze.com 2023-03-17 05:01 出处:网络
I have an application using OmniAuth for authenticating with a variety of social networking services (including Linkedin) and want to post updates. I have the following information on a user from omni

I have an application using OmniAuth for authenticating with a variety of social networking services (including Linkedin) and want to post updates. I have the following information on a user from omniauth:

linkedin_verifier: ****
linkedin_token: *****
linkedin_secret: *****
linkedin_url: http://www.linkedin.com/pub/*****

But can't figure out how to use it to post. I've taken a look at: https://github.com/pengwynn/linkedin, but it requires a request token and request secret (I seem to only have the respo开发者_开发百科nse token and response secret) that I don't get from omniauth. Any ideas?


Have you tried authorize_from_access using the token and secret you get after omniauth?

client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') client.authorize_from_access(linkedin_token, linkedin_secret)


from the link (https://github.com/pengwynn/linkedin) I found this,

You need to get your api keys first, create a client with them and then you will get your request token and response.


#get your api keys at https://www.linkedin.com/secure/developer

client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret')

rtoken = client.request_token.token

rsecret = client.request_token.secret

0

精彩评论

暂无评论...
验证码 换一张
取 消