linkedin : Invalid redirect_uri. This value must match a URL registered with the API Key

后端 未结 7 645
攒了一身酷
攒了一身酷 2020-12-09 16:18

I am using \'omniauth-linkedin-oauth2\'.

When I am login with linkedin then I am getting this error

Invalid redirect_uri. This value must matc

相关标签:
7条回答
  • 2020-12-09 16:49

    please check your redirect_url. for my case I see like this.

    https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=77k93y0w31zaey&redirect_uri=http%3A%2F%2Flocalhost%3A1729%2Fsignin-linkedin&scope=r_basicprofile%2Cr_emailaddress&state=nhAC-nR-CgEwO3XS2ezANhuPBMz-IUmLPJYgGHlZvZ8B1pCfsGBU0PR0dZ5XxE4zbyeI0RLcKByqPLKkgQdqMm4s6DjFYqMCEehYA2iWT9MfioEHjPXGCt2USxUTF0wKBpflCUjG5URVlJa3qI7U3ydFOErZ4Hhnr9SVmKdf1bithYfbOqBx345o8LQLexbddQ687vP6y0szrIyCM6FHip1tCpOY3Hgg5FJQEFH1mCJ_yLunD5vDUN4VVfkQbcjk

    for this I add the url for OAuth 2.0 Authorized Redirect URLs:

    http://localhost:1729/signin-linkedin

    where http://localhost:1729 =base url and
    signin-linkedin = the string which add after base url

    0 讨论(0)
  • 2020-12-09 16:50

    Worth mentioning when one uses libraries to handle oauth: some libraries fail to care about the protocol that is used (or at least require further parametrization). Eg, I gave Linkedin https://example/callback as oauth2 url, but the library sent the request with http://example/callback as parameter.

    0 讨论(0)
  • One more solution is to just verify the client_id you've been using the whole time..because with every update in the list of redirect_uri, the client_id gets updated.

    0 讨论(0)
  • 2020-12-09 16:51

    Went back to LinkedIn developer site (https://www.linkedin.com/secure/developer ) to check my setting again. Everything matches API Key, Secret Key and OAuth 2.0 Redirect URLs.

    Searched web looking for some clues. Couldn’t find a one.
    Crazy issue:

    Then I saw that in the URL Owin was appending some extra string to the redirect_uri “signin-linkedin”.
    When I decoded the URL I saw this http://localhost:54307/signin-linkedin .
    I took this URL and placed it in the OAuth 2.0 Redirect URLs field in the LinkedIn developer site.

    This link is helpful for me
    https://naveengopisetty.wordpress.com/2014/09/15/linkedin-oauth-2-0-issue-invalid-redirect_uri-this-value-must-match-a-url-registered-with-the-api-key/

    0 讨论(0)
  • 2020-12-09 16:51

    After spending hours i finally get to the solution. You got an error no issues just check the url and find redirect_uri. Copy and Paste it's value it in your linkedin dev account oauth2 redirect field.

    0 讨论(0)
  • 2020-12-09 17:01

    I had this when trying to authorise from a zurb Reveal modal popup. In my case, the issue was the URL for the page that was being displayed in the popup was not in my OAuth2 Redirect URLs list on the LinkedIn developer site.

    That was easy to miss because the page URL from the page in the modal is not the URL that was currently showing in the browser's address bar. Once I added the URL for the page being shown in the pop up it worked.

    0 讨论(0)
提交回复
热议问题