Skip to content

LinkedIn connect fails with "Not enough scopes" β€” OAuth flow uses prompt=none, so newly-added member/org scopes are never grantedΒ #1580

Description

@dnlsemf

πŸ“œ Description

Connecting LinkedIn (both personal and Company Page) fails with:

"Could not add provider. Not enough scopes, when choosing a provider, please add all the scopes."

The LinkedIn app is fully and correctly configured (verified company app, all required scopes present, both redirect URIs registered, Advertising API approved). The OAuth callback returns a valid code (no error param), but Postiz still rejects the connection for insufficient scopes.

Root cause appears to be that the LinkedIn authorize URL generated by Postiz contains prompt=none. This performs silent authorization and only returns scopes the user has previously consented to. On a first-time connection β€” or after new scopes are added to the app β€” there is no prior consent, so LinkedIn returns a token missing the member/org scopes, and Postiz throws "Not enough scopes". There is no way to force an interactive consent screen from the UI.

πŸ‘Ÿ Reproduction steps

  1. Configure a LinkedIn app with all scopes: openid, profile, w_member_social, r_basicprofile, rw_organization_admin, w_organization_social, r_organization_social (Advertising API approved so org scopes are grantable).
  2. Set LINKEDIN_CLIENT_ID / LINKEDIN_CLIENT_SECRET in the Postiz env and restart.
  3. Register both redirect URIs in the LinkedIn app: https:///integrations/social/linkedin and https:///integrations/social/linkedin-page
  4. In Postiz: Add Channel β†’ LinkedIn (or LinkedIn Page).
  5. Complete the LinkedIn login. The callback URL returns a valid ?code=... (no error).
  6. Postiz fails with "Could not add provider. Not enough scopes…"

πŸ‘ Expected behavior

Postiz should trigger an interactive LinkedIn consent screen (i.e. NOT prompt=none) when connecting a channel, so the user can grant all requested member/organization scopes. The connection should then succeed and the token should carry all configured scopes.

πŸ‘Ž Actual Behavior with Screenshots

The authorize URL uses prompt=none β†’ LinkedIn silently returns only previously-consented scopes (none on a first connect). The callback returns a valid code, but Postiz rejects it with "Not enough scopes, when choosing a provider, please add all the scopes." No consent screen is ever shown, so the org/member scopes can never be granted through the UI. "Permitted services" in LinkedIn account settings is empty (nothing to revoke/reset). Tried normal window and incognito β€” same result.

πŸ’» Operating system

Linux

πŸ€– Node Version

v22.20.0

πŸ“ƒ Provide any additional context for the Bug.

  • Postiz version: v2.21.8 (self-hosted, Docker, Temporal-based stack)
  • Reverse proxy: Cloudflare Tunnel β†’ host:5105
  • Facebook, Instagram and TikTok connect fine with the same setup – only LinkedIn fails.

πŸ‘€ Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions