-
Notifications
You must be signed in to change notification settings - Fork 147
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
Adds API v2 support, adds profile pic for v2, and adds specs. #38
Adds API v2 support, adds profile pic for v2, and adds specs. #38
Conversation
This would be great to have! Any news about it? Any help needed to move it forward? |
+1 Yesterday I had invalid_credentials anytime a user wanted to sign_in with Linkedin. The error message was.
As @mdesjardins mentioned, it seems that By the way even more surprising, today this error has disappeared and I can login with Linkedin. I was trying @mdesjardins solution but for the moment I get |
Not sure this is the best place to, but I looked on SO and could not find really clear answer. Something is still obscure to me. When does Linkedin decides to update you to V2 ? Why does the doc still refers to v1 for Oauth2 ? Is this endpoint permanent for non-partner to be able to use features such as LinkedinConnect or will it be deprecated? Thanks |
My company was updated to v2 a few weeks ago, I believe it's because we did get approved for some sort of "partner status." I don't know if/when they are planning on releasing the v2 API to everybody. The documentation to it is here, don't know if everyone can see it yet? https://developer.linkedin.com/docs/guide/v2 |
Yup, as @gnapse said, we ran with the same Our solution was to get rid of the Personally I haven't heard anything about LinkedIn deprecating or abandoning support (if any 😄) for V1 of its API, however it makes sense anyway to add the capability of choosing the version. |
Looks like LinkedIn is going to officially deprecate the V1 endpoint on Dec 1 of this year. Any movement on this PR? |
With linkedin confirming the deprecation of V1 APIs in March of the coming year, is there any likelihood that this PR will get moved along? |
@@ -3,6 +3,23 @@ | |||
module OmniAuth | |||
module Strategies | |||
class LinkedIn < OmniAuth::Strategies::OAuth2 | |||
V1_TO_V2_FIELD_MAP = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't think making compatibility attempts with v1 make much sense given how the deprecation time is approaching. Best to just remove v1 cruft and bump major version of this gem, I think.
The current Omniauth strategy works great, but the step to gather raw_info relies on the old v1 API. LinkedIn recently upgraded us to the v2 API, and when they did so they disabled the v1 API, so authentication stopped working. This change allows you to specify the api_version as an option (with v1 still the default) so it will work with both.
Keeping a single default list of fields for both v1 and v2 is tricky because they have different names, and I didn't want to add another option for
fields
that was version-specific, so instead the code converts the v1 field names to v2 names. Unfortunately some of the data (email and location) is much more difficult to get w/ the v2 API, requiring multiple API calls, so I left those two fields out for v2.