문제

The OAuth User Token and OAuth User Secret actually expires in 60 days. I looked at this link, but in my case this is not helpful.

What actually I do in my app:

I use oauth gem for authorization as below.

@linkedin_consumer = OAuth::Consumer.new(
                    API_KEY,
                    SECRET_KEY,
                    { :site => "https://api.linkedin.com" }
                    )
linkedin_access_token = OAuth::AccessToken.new(@linkedin_consumer,OAUTH_USER_TOKEN, OAUTH_USER_SECRET)

Now by using linkedin_access_token I make api calls to get profile data. I get only linkedin id from the users, I never ask user to login in linkedin.com. So, how can I refresh it. please reply ASAP. Thanks.

도움이 되었습니까?

해결책

No endpoints for refreshing linkedin OAuth2.0 Tokens have been mentioned anywhere in their documentation yet. All they say is:

Provided that the user is already logged into LinkedIn, this flow provides you with a simple way of obtaining a valid OAuth 2.0 access token without forcing your user to authorize your application again

But having user logged into LinkedIn wont really solve the purpose of refreshing tokens in backend. OAuth1.0 does have a mechanism mentioned.

One useful discussion on this topic I found : here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top