You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final OAuth20Service service = new ServiceBuilder(clientId)
.apiSecret(clientSecret)
.defaultScope(new ScopeBuilder("r_liteprofile", "r_emailaddress"))
.callback("http://example.com/callback")
.build(LinkedInApi20.instance());
a. LinkedInApi20 need different endpoints: change v2 to rest
After testing, some additional info (I should have done that before creating the issue):
https://www.linkedin.com/oauth/rest/authorization does not work. This URL is used with a redirect in the Browser, this is not realy an api request on which you can add headers. I guess/hope this remains v2.
Linkedin changes to versioned api. See: https://learn.microsoft.com/en-us/linkedin/marketing/versioning?trk=eml-mktg-cust-202304-global-api-migrations-june&mcid=7054174543908663296&src=e-eml&view=li-lms-2023-04
This has some impact.
1.Change needed to OAuth20Service
a. LinkedInApi20 need different endpoints: change v2 to rest
This could be solved by using an extention of LinkedInApi20 with the rest endpoint. But it is better that LinkedInApi20 gets updated.
b. the oauth request need to get a version header. I think for this, scribejava lib needs a change
In the example https://github.com/scribejava/scribejava/blob/master/scribejava-apis/src/test/java/com/github/scribejava/apis/examples/LinkedIn20Example.java change the resource endpoint:
now:
```
private static final String PROTECTED_RESOURCE_URL = "https://api.linkedin.com/v2/me";
private static final String PROTECTED_EMAIL_RESOURCE_URL
= "https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))";
The text was updated successfully, but these errors were encountered: