Change deprecated unversioned LinkedIn API to versioned

Created on 11 May 2023, over 2 years ago
Updated 7 June 2023, about 2 years ago

Problem/Motivation

The unversioned APIs are going to be sunset soon. LinkedIn recommends migrating to the versioned APIs until June 30 2023 as it won't be no longer available after this date.

See: LinkedIn Marketing API Versioning Documentation, Get started with versioning at LinkedIn

Seems like the module is using partially the API URLs here in the client plugin:
https://git.drupalcode.org/project/openid_connect/-/blob/3.x/src/Plugin/OpenIDConnectClient/OpenIDConnectLinkedinClient.php

  /**
   * {@inheritdoc}
   */
  public function getEndpoints(): array {
    return [
      'authorization' => 'https://www.linkedin.com/oauth/v2/authorization',
      'token' => 'https://www.linkedin.com/oauth/v2/accessToken',
      'userinfo' => 'https://api.linkedin.com/v2/me?projection=(id,localizedFirstName,localizedLastName,profilePicture(displayImage~:playableStreams))',
      'useremail' => 'https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))',
    ];
  }

Steps to reproduce

-

Proposed resolution

We could simply change the URLs, but I'm not sure if this will be a long-lasting solution, as it again may change over time (the version etc.). So it might be wise to make the plugins configurable, so they could be easily changed.

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

Feature request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇵🇱Poland sayco Toruń

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024