Converting Linkedin OAuth 1.0 tokens to OAuth 2.0 - linkedin

Like many of you, we are caught in LinkedIn's sudden unannounced change to their Company API.
We've worked out an OAuth 2.0 solution, but we don't want to put all of our users through a scenario where they are forced to come back to our apps and re-connect to linkedin under OAuth2.0 if possible.
I'm wondering if there's an "exchange tokens" method where I can send Linkedin valid OAuth 1.0 tokens and get back a valid OAuth 2.0 token? I seem to recall other services have assisted in migrating tokens but can't find anything on Linkedin's sparse documentation to suggest that they have such a feature.
If anyone knows about an endpoint I can call to convert, I and others would definitely take interest.
TIA,
DW

You cannot do that. You will need to implement OAuth 2.0 to get an OAuth 2.0 token

Related

How to get OAuth token in Business Central Codeunit (al code)

We have been searching and searching to find examples of how to get an OAuth token in al code in our codeunit. We can successfully get the token in Postman, so I know all the credentials are correct. But finding examples on the web of how to do this has proven to be extremely difficult.
I did find this .al page from Microsoft that looks like it has an example using OAuth2.AcquireTokenWithClientCredentials but we can't get it to work. https://github.com/microsoft/BCTech/blob/master/samples/OAuth2Flows/TestOAuth2Flows.Page.al
Does anyone have a working example of this?
Kauffmann has a good blog post on this. It's talking about calling BC with an OAuth token, but the same principle applies.
Are you able to get the OAuth token in AL, and just have trouble using it to authenticate the request? If so, try this from the blog post:
Client.DefaultRequestHeaders.Add('Authorization', GetAuthenticationHeaderValue(AccessToken));
Client.DefaultRequestHeaders.Add('Accept', 'application/json');
If you can't get the token, I'd recommend looking at the OAuth2 codeunit.

Invalied token error in google calendar api

I'm using google calendar api to addd events tocalendar. When I'm using oauth2.0, its asking for oauth and working properly. but after 2 0r 3 try, its failing, it shows invalied token error. And again after some times it work properly.
And if I use the token stored, its asking for oauth2 for the first 1 or 2 attempts and its fine. but its not asking for oauth and no events are being created. agin after some tries its asking for oauth2.
I didn't get any Idea why its happening so. Is there any solution?
This is probably occurring because your tokens are expiring. Include access=offline and prompt=consent in the authorization code link and it will probably start to work. Also make sure to refresh your token of the original access token fails and call the API with the new access token.
I work with Pathfix and it takes off the exact hassle for you if you want to save some time with the OAuth dance :)

I need access to use Linked API version 2

I tried to migrage current API to v2 as recent announcement by Linkedin "all developers need to migrate their apps to our newest APIs and OAuth 2.0 by March 1, 2019".
I have an app using API v1 with OAuth 2.0 to get personal and company profile, share a post on company page.
I tried test with request to https://api.linkedin.com/v2/me**&projection=(id)
System keep saying "Not enough permissions to access..."
On recent attempt to request help, it redirected to stactoverflow that implied I need to apply for access to LinkedIn's Marketing Developer Program to access this API.
I applied for API access via this page https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program#get-started serveral times.
Until now I haven't received any feedback yet.
That is close to the deadline March 1st to migrate to API version 2.
Please advise what I need to access and develop API v2?
First check what permission you have :
In V2 you have to apply for partner program for using company related API
In V2 for talking basic information you have to use r_liteprofile + r_emailaddress
r_liteprofile for firstName,lastName,profilePicture,id - https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams))
r_emailaddress for getting emailAddress - https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))

Linkedin OAuth 1.0 no longer posting to company wall

We have a [legacy] PHP app that is using an old integration to Linkedin (Also using legacy Oauth 1.0a) to post to our users personal, and company wall.
Recently (End of July) we started receiving 500 errors when posting to user's company walls. If the user to chose to post to their personal walls the requests post just fine, it's only the company walls that reject the postings.
The users are admins of the walls (We provide a list of walls the users are admins of that we have previously fetched, and are renewed every time a user wants to post). In the even of the user posting both to their personal wall and company wall at the same time, the personal one succeeds while the company one fails.
I did a quick test using Oauth 2.0 and posting the same data, and it posted just fine.
Anydoby knows what could be the problem, or if Linkedin made any change in their API? According to their documentation, even if use of Oauth 1.0 is not encouraged and the API documentation is not available anymore the service is not deprecated.
On the homepage of https://developer.linkedin.com/ it states:
Effective May 18th, 2018, our Company Pages API will no longer work
with OAuth 1.0. We recommend all apps switchover OAuth 2.0
authentication before then.
So I'd suggest you switch to OAuth 2.0 to maintain your functionality

401 Authentication issue using twitter api with Get Method (oAuth)

I want to search microblogs from twitter using
http://api.twitter.com/1/users/search.xml
using following header to authenticate the request.
{Authorization: OAuth oauth_nonce="NjM0NTU3NjkwODQ1NjI1MDAw",
oauth_signature_method="HMAC-SHA1",oauth_timestamp="1320201086",
oauth_consumer_key="Key Goes Here",
oauth_token="Token goes here",
oauth_signature="D%2FEWfy3qEr5QiEzSvtcYhBDs864%3D",
oauth_version="1.0"
}
but it give me 401 Authentication failed.
Can anybody help me to get out of this.
I would suggest you look into using a pre-made library to handle the Twitter API calls, or, at the very least, OAuth.
In my opinion, it will not be worth your time to work through the many steps required for OAuth request signing.
There are many libraries available (list swiped from dev.twitter.com with inactive projects omitted):
DotNetOpenAuth
Hammock
LINQ to Twitter
OAuth-Dot-Net
Twitterizer
Full disclosure: I am the author of Twitterizer.

Resources