Skip to content

Fix linkedin auth considering new apis#2030

Closed
ChrisWayFor wants to merge 1 commit intohwi:masterfrom
Aurhea:fix-linkedin
Closed

Fix linkedin auth considering new apis#2030
ChrisWayFor wants to merge 1 commit intohwi:masterfrom
Aurhea:fix-linkedin

Conversation

@ChrisWayFor
Copy link

No description provided.

@XWB
Copy link
Member

XWB commented Dec 31, 2024

LinkedinResourceOwnerTest needs to be fixed.

@Khodl
Copy link

Khodl commented Feb 12, 2025

Any idea how I can contribute to this MR?

How do we ensure that existing "old" apps still work when changing that? Linkedin does not provide the same scopes depending on which kind of app it is:

  • New app:
    Screenshot 2025-02-12 at 09 20 12
  • Old app:
    Screenshot 2025-02-12 at 09 20 26

@Khodl
Copy link

Khodl commented Feb 12, 2025

In the meantime, we can use the oAuth2 provider:

I did not manage to make it work all the time: I get a REVOKED_ACCESS_TOKEN most of the time, but sometimes it goes through. Definitely strange.

        linkedin:
            type: oauth2
            class: \HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\OAuth2ResourceOwner
            client_id: '%env(LINKEDIN_CLIENT_ID)%'
            client_secret: '%env(LINKEDIN_CLIENT_SECRET)%'
            access_token_url: "https://www.linkedin.com/oauth/v2/accessToken"
            authorization_url: "https://www.linkedin.com/oauth/v2/authorization"
            infos_url: "https://api.linkedin.com/v2/userinfo"

            scope: openid profile email
            user_response_class: HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse
            paths:
                identifier: sub
                nickname: given_name
                realname: name

@d9beuD
Copy link
Contributor

d9beuD commented Feb 27, 2025

@Khodl maybe this answer could help. I'm running into the same issue.

@d9beuD
Copy link
Contributor

d9beuD commented Feb 27, 2025

How do we ensure that existing "old" apps still work when changing that? Linkedin does not provide the same scopes depending on which kind of app it is:

We could use the same strategy as laravel/socialite#662 (adding a new provider for new apps). linkedin provider stays as it is and we add linkedin_v2 or any other name with @ChrisWayFor's work.

@Khodl
Copy link

Khodl commented Feb 27, 2025

@d9beuD I like your approach, as it does not break anything. Good job!

@XWB
Copy link
Member

XWB commented Feb 27, 2025

Fixed in #2039

@XWB XWB closed this Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants