So, I use omniauth and create LinkedIn for authentication in my Rails 5 application.
omniauth-linkedin-oauth2 (0.2.5) devise (4.4.1)
Everything works fine for the most part, and users can sign up and authenticate using LinkedIn. However, the default image that returns to "auth.info.image" is 50x50, which is too small. I read a lot about this, and the proposed way forward adds "picture-urls: :( original)" to the list of development fields. This is consistent with what I see in the documentation ( https://developer.linkedin.com/docs/fields/basic-profile ). This, however, does not seem to work, and I am wondering if there is an error or is it somehow outdated information.
My devise.rb omniauth configuration is as follows:
config.omniauth Rails.application.config.omniauth, app_key, app_secret], scope: 'r_basicprofile r_emailaddress', fields: %w(id email-address first-name last-name picture-url picture-urls::(original))
Even after specifying these fields, however, no values ββare returned in the image URLs.
self.remote_photo_url = auth.extra.raw_info.pictureUrls['values'].first
I checked the data that was returned and there is no where to find it. Not sure what I could skip, but any advice would be greatly appreciated!
ruby-on-rails omniauth linkedin linkedin-api omniauth-linkedin
Ian shields
source share