decioferreira / omniauth-linkedin-oauth2

A LinkedIn OAuth2 strategy for OmniAuth.
MIT License
117 stars 147 forks source link

Failing to get /me #48

Open mmahalwy opened 5 years ago

mmahalwy commented 5 years ago
E, [2019-02-07T23:56:35.544889 #45219] ERROR -- omniauth: (linkedin) Authentication failure! invalid_credentials: OAuth2::Error, :
{"serviceErrorCode":100,"message":"Not enough permissions to access: GET /me","status":403}
killondark commented 5 years ago

@mmahalwy You need to request permissions from LinkedIn. https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program

killondark commented 5 years ago

or use without scope:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :linkedin, ENV['LINKEDIN_KEY'], ENV['LINKEDIN_SECRET']
end
Piyush-Chaudhary commented 4 years ago

I am also facing the same error with version - (1.0.0) of this gem. Please help anyone. For the detail issue - https://stackoverflow.com/questions/62714338/linkedin-omniauth-gem-omniauth-linkedin-oauth2-giving-authentication-failure

Sakshi1305 commented 4 years ago

Remove scope or field both and try this:

config.omniauth :linkedin, ENV['LINKEDIN_CLIENT_ID'], ENV['LINKEDIN_CLIENT_SECRET']

utkarsh-maropost commented 3 years ago

Mohamed El Mahallawy, @decioferreira how can we solve this issue, I am having same error, I have used devise (ominiauthable), omniauth-linkedin, omniauth-linkedin-oauth2

MY config file devise.rb -

config.omniauth :linkedin, LINKEDIN_APP_KEY, LINKEDIN_APP_SECRET, scope: 'r_liteprofile r_emailaddress'

Please help,

Everthing work fine it redirected to failure mathod and the reason is -

omniauth: (linkedin) Authentication failure! invalid_credentials: OAuth2::Error.