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

Anyone else having issue with LinkedIn provider ? #87

Closed
pksorensen opened this issue Apr 7, 2015 · 55 comments
Closed

Anyone else having issue with LinkedIn provider ? #87

pksorensen opened this issue Apr 7, 2015 · 55 comments

Comments

@pksorensen
Copy link

Today our users stopped being able to login with linked in.

Onlything I have right now from our traces at this point.

Response status code does not indicate success: 405 (Method Not Allowed).; TraceSource 'Owin.Security.Providers.LinkedIn.LinkedInAuthenticationMiddleware' event
[Thinktecture.IdentityServer.Core.Endpoints.AuthenticationController]: 4/7/2015 10:02:53 AM +00:00 -- External identity provider returned error: access_denied; TraceSource 'w3wp.exe' event

I inspect the webredirects and things seem to look fine and I suspect that its in the code to token exchange.

@pksorensen
Copy link
Author

I am guessing this is the error: https://github.com/RockstarLabs/OwinOAuthProviders/blob/master/Owin.Security.Providers/LinkedIn/LinkedInAuthenticationHandler.cs#L238

Now, 405 could be from linked in, but i do not know at this point

@NoelOConnell
Copy link

I'm getting the same issue, only started today and I'm also getting the 405 (Method Not Allowed).

Still haven't figured out if it's LinkedIn or something to do with the code.

I'm looking at the requests in Fiddler now and It seems fine so far.

@pksorensen
Copy link
Author

ye. Was just discussing this with identity server guys. Suggestion was to debug it by hand doign the http calls to see where it goes wrong. Must be in the code 2 token exchange.

My guess is that linkedin changed something since our codebase has not changed since last week and the issue started this morning

@pksorensen
Copy link
Author

reproduced it now: heres the response of the token.

https://gist.github.com/s093294/cbc7c8d3a3da0226d2e2

@pksorensen
Copy link
Author

the request headers are also there in a comment now.

@AlexArchive
Copy link
Contributor

Many thanks for bringing this to our attention, @s093294. I will look into this now. Do bare in mind that it was @jerriep who implemented this provider and not me - I have not touched this provider before. If you find a solution before me, please create a pull request. Cheers.

@pksorensen
Copy link
Author

I dont think the provider is bad. I think its on linkedin https://www.linkedin.com/uas/oauth2/accessToken endpoint that is broken.

@pksorensen
Copy link
Author

POST https://www.linkedin.com/uas/oauth2/accessToken HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: www.linkedin.com
Cookie: bscookie="v=1&201504071234373bc02b47-9d08-477f-8375-b80b281ef416AQEptFjv8jXPI93YmF-H-3kvnwSLwBF8"; bcookie="v=2&46f6f299-6702-48bf-8634-7ba023bd5099"; lidc="b=LB23:g=218:u=215:i=1428410899:t=1428487523:s=AQH0wYHWtbTVED0CrzWvmbkbG4qIEQ3e"
Content-Length: 267
Expect: 100-continue
Connection: Keep-Alive

grant_type=authorization_code&code=AQTNeGrEj1QeV2MOudoi8T1fx1fov-05oSp5dg-HidNxpHtKJ_CkbfcsNyKvuY3eIztVtHQJb883P8QzB5vVvdjYYpR0T9eAjComHVc55quXCs6_RR8&redirect_uri=http%3A%2F%2Flocalhost%3A1729%2Fsignin-linkedin&client_id=&client_secret=

Just removed the secret/clientid, but above results in method not found.

@AlexArchive
Copy link
Contributor

When did you first notice the problem? I wonder if LinkedIn have made a statement yet.

@pksorensen
Copy link
Author

started this morning. noticed the error first time 5 hours ago.

Everything looks correct according to docs: https://developer.linkedin.com/docs/oauth2

I have seen nothing from linkedin

@NoelOConnell
Copy link

+1 confirm that the provider isn't the problem.
I did the oauth2 request manually and still receiving the same error:
"The remote server returned an error: (405) Method Not Allowed."

So either a problem on LinkedIn's end or they changed something and decided not to tell developers again...

@jerriep
Copy link
Contributor

jerriep commented Apr 7, 2015

Thanks for the investigation guys. Given it seems to be on the LinkedIn side I would suggest giving it a few hours and see whether it works itself out.

@AlexArchive
Copy link
Contributor

I want to test this out but I cannot cannot so much as register an account with LinkedIn at the moment.

It always tells me the verification failed. I had a friend test this in America and it happens for him too.

This could be related to our problem here. It looks like their authentication server is being erratic.

@pksorensen
Copy link
Author

there was an update in an answer that might help.
http://stackoverflow.com/a/29493329/871985

When confirmed (if this is the case) How fast can we fix this and get new nugets out? (Asking to find out if i should start making a local copy of the provider to hot fix it local (when solution exists)) or just wait for new nugets.

@AlexArchive
Copy link
Contributor

I am not sure. What do you think, @jerriep?

I am inclined to push an updated package as soon as we have a confirmed fix.

@jerriep
Copy link
Contributor

jerriep commented Apr 7, 2015

Sorry guys, it is getting late evening already here by me, but if you get a fix for that by all means please update package and push :)

@AlexArchive
Copy link
Contributor

Cool. I am still unable to create a LinkedIn account 😠. @s093294, if you submit a pull request, I will be very grateful. I promise I will tend to it promptly.

@pksorensen
Copy link
Author

Sure. Right now I dont think the fix is in the provider. According to the SO answer, if the header is the issue, it is not set by this library sadly :( so not something that can be fixed easily.

@jlcj1974
Copy link

jlcj1974 commented Apr 7, 2015

In .NET, we were able to work around this by explicitly disabling the Expect: 100-Continue for the LinkedIn API URI. Something like this:

protected void Application_Start()
{
var servicePoint = System.Net.ServicePointManager.FindServicePoint(new Uri("https://www.linkedin.com/uas/oauth2/accessToken";));
servicePoint.Expect100Continue = false;
}

I'm not proud of this but it's working locally.

OK, we're getting intermittent issues with this solution, as well. Stay tuned.

@pksorensen
Copy link
Author

Just tested it also and noticed that it actually worked once and then after deploying it didnt work after all. Might be missing something.

@AlexArchive
Copy link
Contributor

What happens when you use @jlcj1974's branch? I just tested it on localhost and it works.

@pksorensen
Copy link
Author

Looks to be working here also.

Should we push out some new nugets based on this to help people using the provider? Would be nice

@AlexArchive
Copy link
Contributor

Awesome 😄. Can you confirm that it works after deploying too?

@pksorensen
Copy link
Author

Either i need to distribute local dlls to do so or wait for updates nugets. Can we generate prerelease packages? But I dont see any reason why it would not work in production also with the change made.

@AlexArchive
Copy link
Contributor

I am being mindful of this comment:

Just tested it also and noticed that it actually worked once and then after deploying it didnt work after all. Might be missing something.

I interpreted that as "the solution works locally but not remotely." I will create a prerelease package now.

@pksorensen
Copy link
Author

I can understand that. I might just have been a little to fast in deploying and could have found out locally that it didnt work as expected.

I still think its a good idea to add this as a prerelease until linkedin comes with a statement. This allows us to update and get a fix that work until we know if linkedin reverts anything or do further changes to the endpoint.

@AlexArchive
Copy link
Contributor

I agree. Working on it now.

@AlexArchive
Copy link
Contributor

I just published a pre-release with the proposed fix. You can find it here. Please report back.

@pksorensen
Copy link
Author

Deployed to our staging deployment and sofar no issues. Deploying to production now also

@pksorensen
Copy link
Author

@AlexArchive
Copy link
Contributor

Nice one.

I hope @linkedin acknowledge this apparent breaking change soon.

@AlexArchive
Copy link
Contributor

Has anyone heard anything from @linkedin? (@s093294 @noeloc @jerriep @jlcj1974)

I am wondering whether I should keep the LinkedIn-Fix in a seperate branch or merge into master and release with 1.17 (opposed to 1.17-pre). It depends if this temporary or not.

@pksorensen
Copy link
Author

Havent heard anything yet.

I would consider the fix stable. But there is always the chance that linkedin changes something again and that could be considered a new fix.

I would keep it as a prerelease for a few days or until @linkedin gives a statement, since this will alert users of the lib to pay attention. If you release 1.17 and linkedin fixes/change something that yet again require a new update of the nugets, this change will reflect badly on the lib instead of on linkedin.

Just my 2cent.

@AlexArchive
Copy link
Contributor

I totally agree.

🐻

@jerriep
Copy link
Contributor

jerriep commented Apr 8, 2015

Hey guys, thanks for all these fixes.

From past experience, I think waiting for any official response from LinkedIn is futile, as communicating with developers is not their strong point ;)

That being said, I am totally cool with keeping it in pre-release mode for now. I am busy working my way through some pull requests, so hanging on before releasing it gives me more time to do that.

@CrazyMORF
Copy link

Hiya everybody,

I have the same issue with LinkedIn, but unfortunately Expect100Continue fix doesn't work for me (at least now). So for now I'm Authorization parameters (like grant_type, code, client_secret etc.) in query part of URI (instead of body of POST request to https://www.linkedin.com/uas/oauth2/accessToken endpoint).

Sad, but it works. Please checkout mine commit if you have same problems as me CrazyMORF@70d0f22

@pksorensen
Copy link
Author

The prerelease package we created do still work here. (Just tested it).

@nikesh-thinkbridge
Copy link

Hi All,

I am also continuing to get the same error even after upgrading to pre release package. i.e access_denied. What should I check for?

@jerriep
Copy link
Contributor

jerriep commented Apr 8, 2015

@jerriep
Copy link
Contributor

jerriep commented Apr 8, 2015

Another tip I can propose is to look at the network traffic in Chrome Developer tools. Make sure though that you have "Preserve Log" enabled so the requests does not clear everytime there is a redirect. A lot of time the clue is hidden somewhere inside the network traffic - you just need to go hunting...

image

@nikesh-thinkbridge
Copy link

yes it was all working till yesterday morning, suddenly stopped working last evening. Then I installed the pre release version as suggested, but I am still getting the same error.

@nikesh-thinkbridge
Copy link

Sure...but the token call would be made by the middleware and not visible in the log right?
just an fyi..i am using an angular app as front end.

@jerriep
Copy link
Contributor

jerriep commented Apr 8, 2015

It depends on what is wrong and when the error happens. When LinkedIn redirects back to your redirect URL it will happen in the browser, and it can happen that it includes more info inside that redirect response.

Typically if redirect URLs does not match, scopes are incorrect, or other cases you will be able to see more details.

So don't just dismiss it out of hand. It is just one way to try and track down the problem. If you do not see anything in the network traffic then we can eliminate that and move on to try something else.

@jerriep
Copy link
Contributor

jerriep commented Apr 8, 2015

Of course if it does happen on the middleware level then you can always try and use Fiddler to monitor network traffic as well.

Seeing as it does work for some people we need to track this down on your end.

I will try it quickly on my side and see whether I get the same issue.

@jerriep
Copy link
Contributor

jerriep commented Apr 8, 2015

Yeah guys, it works 100% on my side as well. You will need to monitor the network traffic on your side with something like Fiddler to see whether you can get a clue about what may be wrong.

Is there anything "strange" about your configurations? Maybe a non-standard callback URL, or non standard scope or anything like that?

@nikesh-thinkbridge
Copy link

Thanks jerrie...My bad....Had changed the url for testing it on local which is on a different key than the production one. Changed it and all works like charm!!!
Sorry for the goof up...but thanks a lot. You guys saved a lot of heartburn!!!!!!

@jerriep
Copy link
Contributor

jerriep commented Apr 8, 2015

No problem :) Glad you're sorted

@nikesh-thinkbridge
Copy link

Thanks to you! But what can we expect from our friends at Linked in......more surprises???!!

@jerriep
Copy link
Contributor

jerriep commented Apr 8, 2015

Most probably ;) These companies aren't always very good with communicating changes to developers... :(

@jerriep
Copy link
Contributor

jerriep commented Apr 9, 2015

Hey everyone. I release 1.17 by mistake without LinkedIn fix, but realised my mistake and released 1.17.1 with LI fix included.

I tested and all works fine. I will close this issue.

If anything else comes up feel free to reopen or create a new issue

@jerriep jerriep closed this as completed Apr 9, 2015
@trotin
Copy link

trotin commented Apr 9, 2015

Hi everyone,

We applied the patch yesterday and it worked fine.
But around 7 hours ago, we received back an "access denied" error when we try to have an authentification using Owin.

Is there anyone with same problem ?

@pksorensen
Copy link
Author

I cannot confirm the problem. Our linkedin sign on has worked since the updated package was added.

@jlcj1974
Copy link

jlcj1974 commented Apr 9, 2015

We deployed yesterday and the patch is still working for us.

On Apr 9, 2015, at 11:36 AM, trotin <notifications@github.commailto:notifications@github.com> wrote:

Hi everyone,

We applied the patch yesterday and it worked fine.
But around 7 hours ago, we received back an "access denied" error when we try to have an authentification using Owin.

Is there anyone with same problem ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/87#issuecomment-91285334.

@AlexArchive
Copy link
Contributor

Hi @trotin,

Many thanks for bringing another potential issue to our attention. Once I saw your comment I tested the patched LinkedIn provider on localhost (version 1.17.1) and it still works. Can you please provide more detail? Could be this a human error, as was the case for another user?

I will leave this issue closed for now, as it seems to be working for everyone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants