Skip to content
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

Implement LinkedIn via OpenID-Connect #81

Open
wants to merge 13 commits into
base: 7.next-cake4
Choose a base branch
from

Conversation

steinkel
Copy link
Member

@steinkel steinkel commented Sep 7, 2023

Setup:

    'OAuth' => [
        'providers' => [
            'linkedInOpenIDConnect' => [
                'service' => \CakeDC\Auth\Social\Service\OpenIDConnectService::class,
                'className' => \League\OAuth2\Client\Provider\LinkedIn::class,
                'mapper' => \CakeDC\Auth\Social\Mapper\LinkedInOpenIDConnect::class,
                'options' => [
                    'redirectUri' => Router::fullBaseUrl() . '/auth/linkedInOpenIDConnect',
                    'linkSocialUri' => Router::fullBaseUrl() . '/link-social/linkedInOpenIDConnect',
                    'callbackLinkSocialUri' => Router::fullBaseUrl() . '/callback-link-social/linkedInOpenIDConnect',
                    'defaultScopes' => ['email', 'openid', 'profile'],
                    // you can check your credentials in the "Auth" tab of your application dashboard in LinkedIn developers page
                    'clientId' => 'YOUR_CLIENT_ID',
                    'clientSecret' => 'YOUR_CLIENT_SECRET',
                ],
            ],
        ],
    ],

@steinkel
Copy link
Member Author

steinkel commented Sep 7, 2023

Note: when merged, we'll need to update the documentation in cakedc/users to reflect this new social provider. A migration guide from the old OAuth2 provider could be a good idea too...

Note2: unit tests being finished now

@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2023

Codecov Report

Merging #81 (7d73629) into 7.next-cake4 (9e126f8) will decrease coverage by 1.45%.
The diff coverage is 47.61%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@                Coverage Diff                 @@
##             7.next-cake4      #81      +/-   ##
==================================================
- Coverage           90.32%   88.87%   -1.45%     
- Complexity            318      330      +12     
==================================================
  Files                  47       49       +2     
  Lines                 775      944     +169     
==================================================
+ Hits                  700      839     +139     
- Misses                 75      105      +30     
Files Coverage Δ
src/Social/Mapper/LinkedInOpenIDConnect.php 100.00% <100.00%> (ø)
src/Social/Service/OpenIDConnectService.php 45.00% <45.00%> (ø)

... and 19 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

3 participants