Everything worked well until today when I received an email from LinkedIn indicating some significant API changes. And subsequently I was seeing Exceptions while authenticating users via. LinkedIn.
Following is the exception from logs
OAuth::Problem (Scope NOT_AUTHORIZED : r_fullprofile):
oauth (0.4.7) lib/oauth/consumer.rb:178:in `request'
oauth (0.4.7) lib/oauth/consumer.rb:194:in `token_request'
oauth (0.4.7) lib/oauth/consumer.rb:136:in `get_request_token'
OAuth logic to get request token.
consumer = OAuth::Consumer.new(LINKED_IN_API_KEY, LINKED_IN_SECRET_KEY,
{
:site => "https://api.linkedin.com",
:scheme => :header,
:http_method => :post,
:request_token_path => "/uas/oauth/requestToken?scope=r_fullprofile",
:access_token_path => "/uas/oauth/accessToken",
:authorizeEmapath => "/uas/oauth/authorize"
})
### Exception occurs at this call.
request_token = consumer.get_request_token(:oauth_callback => callback_url)
Email from LinkedIn
My Analysis till now
If I change the scope to r_basicprofile
it works fine but then I don't get skills
info of the authenticated linkedin user.
What should be the additional changes I need to do to suffice the API change ?
The LinkedIn API uses OAuth 2.0 for member(user) authorization and API authentication. Applications must be authorized and authenticated before they can fetch data from LinkedIn or get access to LinkedIn member data.
Starting from May 12, 2015, Linkedin has limited the open APIs.
Access to r_fullprofile
scopes requires that you apply for and are granted access to this information from LinkedIn. The full profile fields are only available to applications that have applied and been approved for the Apply with LinkedIn use case.
SOLUTION:
Apply for partner status with LinkedIn, explaining what your integration is and how it works. If it meets the criteria of "we feel that they’re providing value to members, developers and LinkedIn," then some or all of the restricted endpoints will remain open for that app, and ONLY that app.
Member profile fields
The following selection of profile fields are available to all LinkedIn developers:
Member profile fields available to Apply with LinkedIn developers:
The following selection of profile fields are only available to applications that have applied and been approved for the Apply with LinkedIn use case:
Check out this linkedin page for more details on which fields are available to all the developers and which are not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With