diff --git a/.env.example b/.env.example index d2ad753b..fc3ed8b5 100644 --- a/.env.example +++ b/.env.example @@ -102,12 +102,9 @@ SPACES_BUCKET= LINKEDIN_CLIENT_ID= LINKEDIN_CLIENT_SECRET= LINKEDIN_CLIENT_REDIRECT="${APP_URL}/accounts/linkedin/callback" -LINKEDIN_PAGE_CLIENT_REDIRECT="${APP_URL}/accounts/linkedin-page/callback" -# Optional: comma-separated OAuth scopes for each LinkedIn connect flow. -# Override these only if your LinkedIn dev app has legacy/enterprise products -# approved — e.g. add `r_basicprofile` to the personal set to re-enable the -# vanityName lookup via /v2/me. Leave unset to use the safe defaults. # LINKEDIN_SCOPES="openid,profile,email,w_member_social" +LINKEDIN_PAGE_CLIENT_REDIRECT="${APP_URL}/accounts/linkedin-page/callback" +LINKEDIN_PAGE_CLIENT_REDIRECT="${APP_URL}/accounts/linkedin-page/callback" # LINKEDIN_PAGE_SCOPES="openid,profile,email,w_organization_social,r_organization_social,rw_organization_admin,w_member_social" # X / Twitter (https://developer.twitter.com) diff --git a/config/trypost.php b/config/trypost.php index b5d35932..a541cd47 100644 --- a/config/trypost.php +++ b/config/trypost.php @@ -80,22 +80,13 @@ 'api' => env('LINKEDIN_API', 'https://api.linkedin.com'), // OAuth host is different from the data API (api.linkedin.com). 'oauth_api' => env('LINKEDIN_OAUTH_API', 'https://www.linkedin.com'), - // Comma-separated OAuth scopes requested on /connect/linkedin. - // Default covers the two products auto-approved for new apps: Sign - // In with LinkedIn (openid, profile, email) + Share on LinkedIn - // (w_member_social). The 2018-deprecated `r_basicprofile` is - // intentionally absent — new apps can't grant it, and requesting it - // makes LinkedIn reject the whole authorize request. Override via - // LINKEDIN_SCOPES if your app has legacy/enterprise products - // approved (e.g. add `r_basicprofile` to re-enable the vanityName - // lookup via /v2/me). + // Scopes for LinkedIn authentication 'scopes' => array_values(array_filter(array_map('trim', explode(',', (string) env('LINKEDIN_SCOPES', 'openid,profile,email,w_member_social'))))), ], 'linkedin-page' => [ 'enabled' => env('LINKEDIN_PAGE_ENABLED', true), 'api' => env('LINKEDIN_PAGE_API', 'https://api.linkedin.com'), - // Comma-separated OAuth scopes requested on the LinkedIn Company - // Page connect flow. Override via LINKEDIN_PAGE_SCOPES. + // Scopes for LinkedIn Page authentication 'scopes' => array_values(array_filter(array_map('trim', explode(',', (string) env('LINKEDIN_PAGE_SCOPES', 'openid,profile,email,w_organization_social,r_organization_social,rw_organization_admin,w_member_social'))))), ], 'x' => [ diff --git a/docker/.env.docker.example b/docker/.env.docker.example index 9395e6f8..5d8e48b6 100644 --- a/docker/.env.docker.example +++ b/docker/.env.docker.example @@ -89,12 +89,8 @@ R2_URL= LINKEDIN_CLIENT_ID= LINKEDIN_CLIENT_SECRET= LINKEDIN_CLIENT_REDIRECT="${APP_URL}/accounts/linkedin/callback" -LINKEDIN_PAGE_CLIENT_REDIRECT="${APP_URL}/accounts/linkedin-page/callback" -# Optional: comma-separated OAuth scopes for each LinkedIn connect flow. -# Override these only if your LinkedIn dev app has legacy/enterprise products -# approved — e.g. add `r_basicprofile` to the personal set to re-enable the -# vanityName lookup via /v2/me. Leave unset to use the safe defaults. # LINKEDIN_SCOPES="openid,profile,email,w_member_social" +LINKEDIN_PAGE_CLIENT_REDIRECT="${APP_URL}/accounts/linkedin-page/callback" # LINKEDIN_PAGE_SCOPES="openid,profile,email,w_organization_social,r_organization_social,rw_organization_admin,w_member_social" X_CLIENT_ID=