Comments (2)
I'm still trying to figure out LinkedIn authentication for omniauth as well and this is probably a bunch of extraneous steps but if nothing else works...
I was able to use this gem https://github.com/acvwilson/linkedin-oauth2 to pull data from the full profile with the LinkedIn API.
I just took that token from the auth hash and stuck it in here.. (based off the linkedin-oauth2 readme)
linkedin_client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret')
linkedin_client.authorize_from_access(TOKEN_FROM_THE_AUTH_HASH)
linkedin_client.profile( fields: 'first-name last-name maiden-name formatted-name... ' )
...and it gives me all the fields!
Please share if you find a better solution than this :)
from omniauth-linkedin-oauth2.
For anyone else running into this, the issue is the whitelist of fields set here:
https://github.com/decioferreira/omniauth-linkedin-oauth2/blob/master/lib/omniauth/strategies/linkedin.rb#L18
I was trying to get positions
, which should be returned by r_basicprofile
I ended up adding positions
to fields
in the devise config:
config.omniauth :linkedin,
ENV["LINKEDIN_CLIENT_ID"],
ENV["LINKEDIN_CLIENT_SECRET"],
scope: 'r_basicprofile r_emailaddress',
fields: ['id', 'email-address', 'first-name', 'last-name', 'headline', 'location', 'industry', 'picture-url', 'public-profile-url', 'positions']
from omniauth-linkedin-oauth2.
Related Issues (20)
- Get the original referer HOT 1
- Unauthorised scope r_liteprofile with linkedin oauth2 HOT 30
- release version that supports omniauth-oauth2 v1.5 HOT 1
- Failing to get /me HOT 5
- Authenticating always shows "allow/deny" prompt for legacy linkedin app HOT 3
- Secret is nil HOT 1
- Getting timeout from Faraday when requesting access_token, email_addrees or profile info HOT 3
- Authentication failure! invalid_credentials: OAuth2::Error HOT 3
- Does the gem return the refresh token when a token is expired? HOT 1
- Non-default scopes
- You need to pass the "client_id" parameter HOT 5
- Using r_emailaddress as scope giving Authentication failure! invalid_credentials: OAuth2::Error HOT 1
- OmniAuth::AuthenticityError HOT 1
- Authentication failure! Connection reset by peer: Faraday::SSLError
- The authorization flow opens the linkedin app and never returns to the callback url (IPHONE) HOT 1
- Why is commit with refresh token support not released to rubygem
- No longer works with oauth2 gem v2.0+ HOT 7
- A required parameter "client_secret" is missing HOT 5
- Linkedin Unversioned API will be deprectaed by June 30 HOT 1
- access_token post request HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from omniauth-linkedin-oauth2.