Linked to Omniauth photo_urls or picture-urls: :( original) not returned

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!

+8
ruby-on-rails omniauth linkedin linkedin-api omniauth-linkedin
source share
1 answer

I have imported photos with the fields 'picture-urls: :( original)' for many years, but since 2018/2/26 about half of the profiles did not return this field, and from 2018/3/1 none of them returned it.

There is no API status that I know of. I experienced many LinkedIn API problems that lasted 2-3 days and then mysteriously disappear. This is an unusually long option.

+5
source share

All Articles