Giter Site home page Giter Site logo

Comments (5)

ockam avatar ockam commented on September 28, 2024

I don’t know if its related, but after further testing, I realised I have set my LinkedIn application default permission to r_basicprofile, r_emailaddress and w_share.

Adding r_basicprofile to my scope just duplicate the permission in the LinkedIn authentication pane, but If I remove w_share from my scope, it doesn’t appear in the pane, so I just kept w_share.

Eiither way, I always get the same raw array.

from eloquent-oauth-l5.

ockam avatar ockam commented on September 28, 2024

OK. I now know what is happening.

First, the LinkedIn provider already has default scopes (r_basicprofile and r_emailaddress). Scopes from config are appended so, if you repeat those in the config, they duplicate and the LinkedIn API doesn’t deal with duplicate (you will see permission request twice for each scope that is a duplicate).

Second, the LinkedIn API doesn’t automatically return all possible fields for a scope. You need to specify the ones you need.

Since there is no way to specify the profile fields, I will need to extends the provider, but that would be a nice feature to add.

from eloquent-oauth-l5.

ockam avatar ockam commented on September 28, 2024

In case someone else hits the same issue, here’s what you need to do.

First, extend EloquentOAuthServiceProvider to register your custom social provider:

namespace App\Providers;

use  AdamWathan\EloquentOAuthL5\EloquentOAuthServiceProvider;

class CustomSocialLoginServiceProvider extends EloquentOAuthServiceProvider
{

    protected $providerLookup = [
        'linkedin' => 'App\Providers\AppLinkedInProvider',
    ];
}

Then add this provider to your app config providers array instead of the original one.

Finally, extend the LinkedIn provider and add your required fields:

namespace App\Providers;

use SocialNorm\LinkedIn\LinkedInProvider;

class AppLinkedInProvider extends LinkedInProvider
{
    /**
     * LinkedIn fields must be specified to be included in the response
     *
     */
    protected $profileFields = array(
        'id',
        'first-name',
        'last-name',
        'email-address',
        'picture-url',
        'headline',
        'location:(name)',
        'public-profile-url',
    );
}

from eloquent-oauth-l5.

adamwathan avatar adamwathan commented on September 28, 2024

Ah, Facebook made some updates recently that had the same effect. I was thinking of making the fields configurable for that reason and this is another push in that direction...

from eloquent-oauth-l5.

adamwathan avatar adamwathan commented on September 28, 2024

Closing because this package is no longer actively maintained; for changes, fixes, or new features, please fork.

from eloquent-oauth-l5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.