@@ -22,9 +22,9 @@ class Linkedin extends AbstractService
2222 /**
2323 * Defined scopes.
2424 *
25- * @see http ://developer.linkedin .com/documents/ authentication#granting
25+ * @see https ://docs.microsoft .com/en-us/linkedin/shared/ authentication/authorization-code-flow?context=linkedin/context
2626 */
27- const SCOPE_R_BASICPROFILE = 'r_basicprofile ' ;
27+ const SCOPE_R_LITEPROFILE = 'r_liteprofile ' ;
2828 const SCOPE_R_FULLPROFILE = 'r_fullprofile ' ;
2929 const SCOPE_R_EMAILADDRESS = 'r_emailaddress ' ;
3030 const SCOPE_R_NETWORK = 'r_network ' ;
@@ -33,7 +33,7 @@ class Linkedin extends AbstractService
3333 const SCOPE_RW_COMPANY_ADMIN = 'rw_company_admin ' ;
3434 const SCOPE_RW_GROUPS = 'rw_groups ' ;
3535 const SCOPE_W_MESSAGES = 'w_messages ' ;
36- const SCOPE_W_SHARE = 'w_share ' ;
36+ const SCOPE_W_MEMBER_SOCIAL = 'w_member_social ' ;
3737
3838 public function __construct (
3939 CredentialsInterface $ credentials ,
@@ -42,10 +42,14 @@ public function __construct(
4242 $ scopes = [],
4343 ?UriInterface $ baseApiUri = null
4444 ) {
45+ if (count ($ scopes ) === 0 ) {
46+ $ scopes = [self ::SCOPE_R_LITEPROFILE , self ::SCOPE_R_EMAILADDRESS ];
47+ }
48+
4549 parent ::__construct ($ credentials , $ httpClient , $ storage , $ scopes , $ baseApiUri , true );
4650
4751 if (null === $ baseApiUri ) {
48- $ this ->baseApiUri = new Uri ('https://api.linkedin.com/v1 / ' );
52+ $ this ->baseApiUri = new Uri ('https://api.linkedin.com/v2 / ' );
4953 }
5054 }
5155
@@ -54,15 +58,15 @@ public function __construct(
5458 */
5559 public function getAuthorizationEndpoint ()
5660 {
57- return new Uri ('https://www.linkedin.com/uas/oauth2 /authorization ' );
61+ return new Uri ('https://www.linkedin.com/oauth/v2 /authorization ' );
5862 }
5963
6064 /**
6165 * {@inheritdoc}
6266 */
6367 public function getAccessTokenEndpoint ()
6468 {
65- return new Uri ('https://www.linkedin.com/uas/oauth2 /accessToken ' );
69+ return new Uri ('https://www.linkedin.com/oauth/v2 /accessToken ' );
6670 }
6771
6872 /**
0 commit comments