POST https://www.linkedin.com/uas/oauth2/accessToken HTTP/1.1 results in Method Not Found on LinkedIn

。_饼干妹妹 提交于 2019-11-30 09:58:12

I also spent most of the morning off and on trying to get this to work. Frustratingly it worked fine using Advanced Rest Client chrome tool. A combination of this and fiddler showed the only difference in the header was that Expect: 100-continue flag in the header. The only way I was able to get it to be set to false was in the web.config section

<system.net>
    <settings>
        <servicePointManager expect100Continue="false" />
    </settings>
</system.net>

Hope this helps.

I ran into this issue this morning too (I'm using DotNetOpenAuth). It looks like this is related to the use of the following request header: Expect: 100-continue

After removing this request header, the HTTP/1.1 405 Method Not Allowed response no longer occurs. Obviously this isn't much help if you don't have access to the source code!

I'm assuming this is due to a change in LinkedIn as I only started experiencing problems this morning. I'm guessing they'll need to look into a fix for this.

I started having this issue today. After some research about Expect: 100-continue I found that putting System.Net.ServicePointManager.Expect100Continue = false;

in my Application_Start() function inside of Global.asax, takes out the 100-continue from the request and my login with LinkedIn is now working again.

Not a permanent fix as I would like to now why it broke in the first place.

I had same issue also use DotNetOpenAuth.

How I fix:

  1. I remove from request header "Expect: 100-continue"
  2. in my case redirect_uri was encoded and I remove encode for redirect_uri (for request to https://www.linkedin.com/uas/oauth2/accessToken )

For those using Owin Middleware and Owin.Security.Providers

A pre-release nuget was created with a fix. https://www.nuget.org/packages/Owin.Security.Providers/1.17.0-pre

This works for now. But until we know what linkedin has changed or comes with statement about what they changed people can use this as a hotfix.

Alittle more background on the fix can be found at : https://github.com/RockstarLabs/OwinOAuthProviders/issues/87#issuecomment-90838017

But the root cause is that LinkedIn changed something on there accessToken endpoint causing most of the libs using linkedin SSO had to apply a hotfix, but we yet haven't heard anything from linkedin.

Found a solution for curl, pretty simple:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:') );
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!