![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
omniauth-linkedin-oauth2
Advanced tools
A LinkedIn OAuth2 strategy for OmniAuth.
For more details, read the LinkedIn documentation: https://developer.linkedin.com/docs/oauth2
Add this gem to your application's Gemfile:
bundle add omniauth-linkedin-oauth2
Or install it yourself as:
$ gem install omniauth-linkedin-oauth2
This version is a major upgrade to the LinkedIn API version 2. As such, it switches from the soon to be no longer available r_basicprofile
to r_liteprofile
. This results in a much limited set of data that we can get from LinkedIn.
Previous versions of this gem used the provider name :linkedin_oauth2
. In order to provide a cleaner upgrade path for users who were previously using the OAuth 1.0 omniauth adapter for LinkedIn [https://github.com/skorks/omniauth-linkedin], this has been renamed to just :linkedin
.
Users who are upgrading from previous versions of this gem may need to update their Omniauth and/or Devise configurations to use the shorter provider name.
Register your application with LinkedIn to receive an API key: https://www.linkedin.com/secure/developer
This is an example that you might put into a Rails initializer at config/initializers/omniauth.rb
:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :linkedin, ENV['LINKEDIN_KEY'], ENV['LINKEDIN_SECRET']
end
You can now access the OmniAuth LinkedIn OAuth2 URL: /auth/linkedin
.
With the LinkedIn API, you have the ability to specify which permissions you want users to grant your application. For more details, read the LinkedIn documentation: https://developer.linkedin.com/docs/oauth2
By default, omniauth-linkedin-oauth2 requests the following permissions:
'r_liteprofile r_emailaddress'
You can configure the scope option:
provider :linkedin, ENV['LINKEDIN_KEY'], ENV['LINKEDIN_SECRET'], :scope => 'r_liteprofile'
When specifying which permissions you want to users to grant to your application, you will probably want to specify the array of fields that you want returned in the omniauth hash. The list of default fields is as follows:
['id', 'first-name', 'last-name', 'picture-url', 'email-address']
Here's an example of a possible configuration where the fields returned from the API are: id, first-name and last-name.
provider :linkedin, ENV['LINKEDIN_KEY'], ENV['LINKEDIN_SECRET'], :fields => ['id', 'first-name', 'last-name']
To see a complete list of available fields, consult the LinkedIn documentation at: https://developer.linkedin.com/docs/fields
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that omniauth-linkedin-oauth2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.