|
3 | 3 | **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
4 | 4 |
|
5 | 5 | - [LinkedIn as authsource](#linkedin-as-authsource)
|
| 6 | + - [Enabling OIDC in your LinkedIn App](#enabling-oidc-in-your-linkedin-app) |
6 | 7 | - [Usage](#usage)
|
7 |
| -- [Migrarting from OAuth v1 authlinkedin](#migrarting-from-oauth-v1-authlinkedin) |
8 | 8 |
|
9 | 9 | <!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
10 | 10 |
|
11 | 11 | # LinkedIn as authsource
|
12 | 12 |
|
13 |
| -LinkedIn recommends using OAuth2 and their v2 apis. Their v1 apis and |
14 |
| -OAuth1 endpoints are being shutdown. LinkedIn v2 apis return data in a |
15 |
| -more complex format (json keys change based on language) and require |
16 |
| -additional API calls to get an email address. You need to use the |
17 |
| -`authoauth2:LinkedInV2Auth` authsource since LinkedIn doesn't conform |
18 |
| -the expected OIDC/OAuth pattern. |
| 13 | +The `LinkedInV2Auth` authsource has been deprecated, and we now recommend the use of OIDC, which is enabled in the LinkedIn developer portal via their [Sign In with LinkedIn V2](https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2#what-is-openid-connect) product. Use of OIDC facilitates the use of standard configuration patterns and claims endpoints. |
| 14 | + |
| 15 | +## Enabling OIDC in your LinkedIn App |
| 16 | + |
| 17 | +OIDC can be enabled in your existing LinkedIn App by simply adding **Sign In with LinkedIn v2** to your app's products. See the [Cirrus Identity Blog article](https://blog.cirrusidentity.com/enabling-linkedins-oidc-authentication) for details. |
19 | 18 |
|
20 | 19 | # Usage
|
21 | 20 |
|
22 | 21 | ```php
|
23 | 22 | 'linkedin' => [
|
24 |
| - 'authoauth2:LinkedInV2Auth', |
| 23 | + 'authoauth2:OAuth2', |
| 24 | + 'template' => 'LinkedInOIDC', |
25 | 25 | 'clientId' => $apiKey,
|
26 | 26 | 'clientSecret' => $apiSecret,
|
27 |
| - // Adjust the scopes: default is to request email and liteprofile |
28 |
| - // 'scopes' => ['r_liteprofile'], |
29 |
| - ], |
30 |
| -``` |
31 |
| - |
32 |
| -# Migrating from OAuth v1 authlinkedin |
33 |
| - |
34 |
| -The `authlinkedin` module bundled with most versions of SSP uses |
35 |
| -deprecated OAuth v1 and v1 API endpoints. To migrate to the new |
36 |
| -LinkedIn API you will need to add a [redirect URI to your linkedin |
37 |
| -application](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/consumer/context). The |
38 |
| -redirect URI is |
39 |
| - |
40 |
| - https://hostname/SSP_PATH/module.php/authoauth2/linkback.php |
41 |
| - |
42 |
| -You will then need to change your `authsource` configuration to match the example usage above. |
43 |
| - |
44 |
| -On your IdP side you may need to use `linkedin2name` from this module rather than `authlinkedin`. |
45 |
| - |
46 |
| -```php |
47 |
| - // Convert linkedin names to ldap friendly names |
48 |
| - 10 => array('class' => 'core:AttributeMap', 'authoauth2:linkedin2name'), |
| 27 | + // Adjust the scopes: default is to request 'openid' (required), |
| 28 | + // 'profile' and 'email' |
| 29 | + // 'scopes' => ['openid', 'profile'], |
| 30 | + ] |
49 | 31 | ```
|
50 |
| -There are some minor changes in user experience and consent which are outlined in [our blog post](https://blog.cirrusidentity.com/linkedin-user-interaction-changes). |
0 commit comments