LinkedIn returns 401: unknown authentication scheme when trying to share
<p>I am trying to implement sharing to LinkedIn in our project. It works for me like a charm, however, for all of my colleagues, it does not. It returns <code>401: Unknown authentication scheme</code> just for sharing request (profile requests work fine).</p>

<p>The LinkedIn app that we use is owned by me. For testing purposes another developer tried to create an app in his account, but the problem stayed: I was the only one who could share.</p>

<p>We are using <a href="https://github.com/ashwinks/PHP-LinkedIn-SDK" rel="nofollow">linkedinapi/linkedin</a> for back-end. Here's the code:</p>

<pre><code>protected function openConnection()
{
    $credentials = \Config::get('services.linkedin');

    try
    {
        $this-&gt;connection = new \LinkedIn\LinkedIn([
            'api_key' =&gt; $credentials['client_id'],
            'api_secret' =&gt; $credentials['client_secret'],
            'callback_url' =&gt; $credentials['redirect'],
        ]);

        $this-&gt;connection-&gt;setAccessToken(\Auth::user()-&gt;linkedin-&gt;token['access_token']);
    }
    catch (\Exception $e)
    {
        \Log::error('Failed LinkedIn auth, exception is attached', [$e]);

        throw new CouldNotPostException('Please, re-link your LinkedIn account, failed to send your post to LinkedIn.');
    }
}

protected function send()
{
    $object = [
        'content' =&gt; [
            'title' =&gt; $this-&gt;post-&gt;title,
            'description' =&gt; \Str::limit($this-&gt;post-&gt;description, 253),
            'submitted-url' =&gt; $this-&gt;post-&gt;shortlink,
            'submitted_image_url' =&gt; \URL::to($this-&gt;post-&gt;image),
        ],
        'comment' =&gt; $this-&gt;content,
        'visibility' =&gt; [
            'code' =&gt; 'connections-only'
        ]
    ];

    try
    {
        $result = $this-&gt;connection-&gt;post('/people/~/shares?format=json', $object);

        $this-&gt;posted($result['updateKey']);
    }
    catch (\Exception $e)
    {
        \Log::error('Failed LinkedIn posting, exception is attached', [$e]);

        throw new CouldNotPostException('Failed to send your post to LinkedIn, our developers have been notified of this error.');
    }
}
</code></pre>

<p><strong>UPD:</strong> turns out it can post only on my machine, so there is something wrong with the configuration on their machines. Looking for it.</p>