2

I am currently trying to use the LinkedIn REST API. I am using C# and I have been having trouble with OAuth. I have looked at various posts such as this: OAuth with Verification in .NET, which really explained most of the confusing topics, but I am stuck on something that is apparently too obvious to mention: where does the Redirect URL come from? Is this something that LinkedIn should supply? Or is there some format I need to follow for a valid URI? I feel like I must be missing something very obvious or that I must really not understand this stuff at all. Any help would be appreciated!

James

Community
  • 1
  • 1
James Allingham
  • 696
  • 1
  • 8
  • 27

2 Answers2

2

1)Why you need this : Server returns Outh token that is embedded in redirect url, you just need to get that code out of the redirect url and use it for permitted actions(post,editing,tweet etc).
2) How to put this: you will give Redirect url in App Settings or pass it while making request.

For example for facebook: This will be initial link you will create ,one of its parameter is redirect_uri https://www.facebook.com/login.php?login_attempt=1&next=https%3A%2F%2Fwww.facebook.com%2Fv2.1%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Fsample.tumblr.com%252F%26display%3Dpopup%26response_type%3Dcode%26client_id%3D549177888517555%26ret%3Dlogin&popup=1

It will be there in Last Successful Response from the server in location header. if you are using webbrowser,it will automatically redirect to the url.

Charlie
  • 4,827
  • 2
  • 31
  • 55
  • Thanks for explaining why this is needed. However I was more confused about where to find the correct URL. However I found that most services supply it in the developer documentation. That said it is still a bit confusing, so I am hoping there is a simple method for finding it. – James Allingham Dec 10 '14 at 09:06
  • As you can see, i am using my tumblr web page for this purpose and it works fine. That is easy. you can give any url ,Most Apps doesn't check it so you can even give it wrong. I have not tried but i think if you give www.stackoverflow.com redirection url will be something like www.stackoverflow.com?code=xxxxxxxx – Charlie Dec 10 '14 at 10:32
  • 1
    One thing to note is that you have to register your redirect uri on your application settings page for it to work successfully. https://developers.linkedin.com/documents/authentication – Anna Keramaty Dec 10 '14 at 21:46
0

The redirect URL comes from you, you need to create an endpoint on your webapp e.g. http://mysite/api/callback.

Once the request has been authenticated, the token issuance endpoint goes to redirect uri along with token information

under redirect uri, you can extract the code/token information for further use and redirect to the original url.