I'm using Devise and the omniauth-linkedin gem to allow users to log into my Rails app with a LinkedIn account (Rails 4.1.8, Devise 3.4.0, omniauth-linkedin 0.2.0). I've had no trouble getting the user's primary email from LinkedIn, but I'm wondering, is it possible to get a list of ALL the emails associated with the user's LinkedIn account, including non-primary emails?
The LinkedIn docs (https://developer.linkedin.com/documents/authentication) don't say how to do this, but they also don't say that it's impossible.
If it IS possible, what scopes/fields do I need to add to my Devise config? Currently the relevant line in config/devise.rb looks like this:
config.omniauth :linkedin, ENV['LINKEDIN_KEY'], ENV['LINKEDIN_SECRET'],
scope: 'r_fullprofile r_emailaddress r_network w_messages',
fields: ["id", "email-address", "first-name", "last-name", "headline",
"industry", "picture-url", "public-profile-url", "location",
"connections"]
The LinkedIn Profile API does not expose email addresses other than the primary one associated with a member profile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With