diff --git a/src/OAuth/OAuth2/Service/Linkedin.php b/src/OAuth/OAuth2/Service/Linkedin.php index 65cfd946..071466e8 100644 --- a/src/OAuth/OAuth2/Service/Linkedin.php +++ b/src/OAuth/OAuth2/Service/Linkedin.php @@ -20,9 +20,10 @@ class Linkedin extends AbstractService { /** * Defined scopes - * @link http://developer.linkedin.com/documents/authentication#granting + * + * @link https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context */ - const SCOPE_R_BASICPROFILE = 'r_basicprofile'; + const SCOPE_R_LITEPROFILE = 'r_liteprofile'; const SCOPE_R_FULLPROFILE = 'r_fullprofile'; const SCOPE_R_EMAILADDRESS = 'r_emailaddress'; const SCOPE_R_NETWORK = 'r_network'; @@ -31,7 +32,7 @@ class Linkedin extends AbstractService const SCOPE_RW_COMPANY_ADMIN = 'rw_company_admin'; const SCOPE_RW_GROUPS = 'rw_groups'; const SCOPE_W_MESSAGES = 'w_messages'; - const SCOPE_W_SHARE = 'w_share'; + const SCOPE_W_MEMBER_SOCIAL = 'w_member_social'; public function __construct( CredentialsInterface $credentials, @@ -40,10 +41,14 @@ public function __construct( $scopes = array(), UriInterface $baseApiUri = null ) { + if (count($scopes) === 0) { + $scopes = array(self::SCOPE_R_LITEPROFILE, self::SCOPE_R_EMAILADDRESS); + } + parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri, true); if (null === $baseApiUri) { - $this->baseApiUri = new Uri('https://api.linkedin.com/v1/'); + $this->baseApiUri = new Uri('https://api.linkedin.com/v2/'); } } @@ -52,7 +57,7 @@ public function __construct( */ public function getAuthorizationEndpoint() { - return new Uri('https://www.linkedin.com/uas/oauth2/authorization'); + return new Uri('https://www.linkedin.com/oauth/v2/authorization'); } /** @@ -60,7 +65,7 @@ public function getAuthorizationEndpoint() */ public function getAccessTokenEndpoint() { - return new Uri('https://www.linkedin.com/uas/oauth2/accessToken'); + return new Uri('https://www.linkedin.com/oauth/v2/accessToken'); } /** diff --git a/src/OAuth/OAuth2/Service/Netatmo.php b/src/OAuth/OAuth2/Service/Netatmo.php index eb5c68d9..65e954dd 100644 --- a/src/OAuth/OAuth2/Service/Netatmo.php +++ b/src/OAuth/OAuth2/Service/Netatmo.php @@ -36,6 +36,18 @@ class Netatmo extends AbstractService const SCOPE_THERMOSTAT_READ = 'read_thermostat'; // Used to configure the thermostat (syncschedule, setthermpoint) const SCOPE_THERMOSTAT_WRITE = 'write_thermostat'; + // Used to retrieve Welcome data (Gethomedata, Getcamerapicture) + const SCOPE_READ_CAMERA = 'read_camera'; + // Used to tell Welcome a specific person or everybody has left the Home (Setpersonsaway) + const SCOPE_WRITE_CAMERA = 'write_camera'; + // Used to access the camera, the videos and the live stream. + const SCOPE_ACCESS_CAMERA = 'access_camera'; + // Used to retrieve Presence data (Gethomedata, Getcamerapicture) + const SCOPE_READ_PRESENCE = 'read_presence'; + // Used to access the camera, the videos and the live stream. + const SCOPE_ACCESS_PRESENCE = 'access_presence'; + // Used to read data coming from Healthy Home Coach (gethomecoachsdata). + const SCOPE_READ_HOMECOACH = 'read_homecoach'; public function __construct( CredentialsInterface $credentials, diff --git a/src/OAuth/OAuth2/Service/Strava.php b/src/OAuth/OAuth2/Service/Strava.php index 208ec635..83da5654 100644 --- a/src/OAuth/OAuth2/Service/Strava.php +++ b/src/OAuth/OAuth2/Service/Strava.php @@ -33,7 +33,7 @@ class Strava extends AbstractService * Scopes */ // default - const SCOPE_PUBLIC = 'public'; + const SCOPE_READ = 'read'; // Modify activities, upload on the user’s behalf const SCOPE_WRITE = 'write'; // View private activities and data within privacy zones @@ -49,7 +49,7 @@ public function __construct( UriInterface $baseApiUri = null ) { if (empty($scopes)) { - $scopes = array(self::SCOPE_PUBLIC); + $scopes = array(self::SCOPE_READ); } parent::__construct(