[LinkedIn Connector] "Bad Redirect" message

[LinkedIn Connector] "Bad Redirect" message

  
Forge Component
(1)
Published on 20 Oct by OutSystems
1 vote
Published on 20 Oct by OutSystems
First of all, thank you for all the great work done on building the various connectors (Facebook, Dropbox, LinkedIn, etc)!

I am experiencing an error that I hope someone may be able to assist with. I have setup the LinkedIn Connector demo based on the documentation, including registering the application in LinkedIn and using the API key and Secret Key in my demo app. However, when I try and then log in to LinkedIn through the demo app, I get redirected to a LinkedIn error screen that states "Invalid redirect_uri. This value must match a URL registered with the API key.".

I have double-checked that my app settings in the LinkedIn developer section match the configuration in the demo documentation, including the callback redirect for the OAuth 2.0. This is the same as I have done in the other connector demos (Facebook, Dropbox, etc) which all worked, but for some reason it doesn't seem to be working for LinkedIn.

I did a Service Studio debug trace on the Callback flow in the LinkedIn connector, and from what I can see the error might be originating from the "state" variable not being set internally, which means it isn't being passed in the URL call from LinkedIn.

Any help or thoughts on this would really be appreciated! Thanks again.
Hello Charl!

Thanks for your kind workds.

I was checking in my own usage of the LinkedIn Connector Demo, and the configuration I have in my LinkedIn account is the same that you can see in the documentation. Something like 'https://myserver/LinkedinConnector/Callback.aspx'.

There could be a difference in the name of your server. For example, my server has a name that I can use to access it in my internal network (devsrv01). But it also as a full qualified name like devsrv01.outsystems.com. Could it be something like this that is causing the error? If the server can have both names, you can set them both as redirect_url's in LinkedIn, separated by a comma

Can you post here the URL that you have configured in LinkedIn and the address that you use in your browser to access the demo?

Thanks
Pedro Cardoso

Hi Pedro

Thank you for the quick and detailed reply, I appreciate it!

So I was tinkering a little more, and found the issue on my side. As is so often true in development roadblocks, it came down to one character :) The OAuth 2.0 URL that I had entered in the LinkedIn development site app setting was ".../LinkedInConnector/Callback...", whilst the path to my connector is actually ".../LinkedinConnector/Callback...". Spot the difference? I needed to changed "LinkedIn" to "Linkedin", so my learning for the day is to ensure that URLs are case-identical!

Everything is now running well, thank you again for your help! The URL for my LinkedIn Demo app is https://skycharl.outsystemscloud.com/LinkedinConnDemo.

Have a great day!

Charl
Oh!!!

You are very welcome Charl, and thanks for letting me know that. I'm including it in the documentation right away.

Have a great day!