Skip to content

Strava changed "public" scope to "read" #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/OAuth/OAuth2/Service/Linkedin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand All @@ -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/');
}
}

Expand All @@ -52,15 +57,15 @@ 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');
}

/**
* {@inheritdoc}
*/
public function getAccessTokenEndpoint()
{
return new Uri('https://www.linkedin.com/uas/oauth2/accessToken');
return new Uri('https://www.linkedin.com/oauth/v2/accessToken');
}

/**
Expand Down
12 changes: 12 additions & 0 deletions src/OAuth/OAuth2/Service/Netatmo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth/OAuth2/Service/Strava.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down