1

I am trying to test out the YouTube Data API V3 to Upload a Video to YouTube in C# using the example code supplied.

I am using the OAuth2 method. I have generated a Client ID / Secret successfully.

The issue I am having is that created a standard C# MVC ASP.NET project, and every time I run it it might say for example http://localhost:5151/.

We are on a private network so I usually have to use something like ngrok to receive anything from the outside world being sent directly to my server / machine.

Anyways, where was I? So every time I run my application it says in my url box http://localhost:5151/ but when I attempt to run the code in the sample I provided above, it fails to validate me as a user because they claim that the redirect uri's I have set up in the Google API dashboard are not the same as the url being used.

So for example, in my Google API Dashboard redirect uri list I have http://localhost:5151/. But the google misdirect uri error that comes back claims that I am running on http://localhost:6163/ .

So I think wait, that must be just a fluke. So I run my application again and now in the url it again says what I would assume it should: http://localhost:5151/, but I again get the same google error_mismatch_redirect_uri error but this time with a different port: http://localhost:6621/ !!

I'm not sure what settings are on our servers but it looks like in the background my application is starting up on some random port every time and thus google thinks the redirect uri's dont match! What can I do to fix this? Am I missing something trivial here?

UPDATE: Tried using http://localhost:8080 per their documentation. Still didn't work.

Yusha
  • 1,496
  • 2
  • 14
  • 30

1 Answers1

1

Wow, after hours of searching I found the answer here: https://stackoverflow.com/a/28794316/7010468. Apparently you have to put http://localhost/authorize/ in your list of redirect-uris...

Yusha
  • 1,496
  • 2
  • 14
  • 30