Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LinkedIn OAuth 2.0 Redirect URL

I'm attempting to sign in users with the LinkedIn Omniauth 2 gem. I have tried a few different possibilities for the redirect, read several articles and nothing is working.

I'm trying to test this locally. Rails 4 app

Gems include: omniauth omniauth-linkedin-oath2

A few attempts of the redirect URL to put in the box includ:

https://www.linkedin.com/uas/oauth2/authorization?client_id=759dczzx23nyic&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Flinkedin%2Fcallback&response_type=code&scope=r_basicprofile+r_emailaddress&state=8da572e31a8e66e6b1de54acddd14937d976ed06d7ed3217&client_id=*

  • = API Key that needs to stay private

    http://localhost:3000
    
    http://localhost:3000/
    
    http://www.localhost:3000
    
    https://localhost:3000
    
    https://localhost:3000/
    
    https://www.localhost:3000
    

I read both of these articles the entire way through, but still couldn't attempt to find the correct way to redirect it.

https://developer.linkedin.com/forum/register-your-oauth-2-redirect-urls

https://developer.linkedin.com/forum/oauth-20-redirect-url-faq-invalid-redirecturi-error

Any help in what I need to change would be great.

like image 475
LMo Avatar asked Sep 29 '14 17:09

LMo


2 Answers

They need to match exactly what you are sending:

http://localhost:3000/auth/linkedin/callback

like image 51
Eugenio Pace Avatar answered Nov 13 '22 14:11

Eugenio Pace


In case of Linkedin Authorized Redirect URLs should be in form of:

  1. http://localhost:8080/your-project-name/auth/linkedin

After authentication if you want to redirect to a specific page then

  1. http://localhost:8080/your-project-name/that-page-url
like image 2
Amit Singh Rathore Avatar answered Nov 13 '22 14:11

Amit Singh Rathore