I’m creating a program that requests information from the Google Calendar API, and I’ve gotten to the point that pretty much all authentication works properly so far. When I go to test the program, though, I always run into an error saying that the app’s request is invalid.
The details of the error say that it’s the 404 redirect_uri_mismatch, and directs me to add the redirect URI http://127.0.0.1:59249/authorize/flowName=GeneralOAuthFlow to the list of redirect URIs in the project.
I’m having trouble figuring out how I’m supposed to add a URI in this format to the allowed URIs if the port number in the URI is going to change each time I make a request. Is there a way to lock the port that the request is made from so that it matches the redirect URI, or a way to allow a range of values for that port in the project settings?
I have tried adding to the URI the port specified in the LaunchSettings.json file in hopes that it the request would be made from that port, but it didn’t work. The test launches at the https://localhost:7000 address, but the port received in the redirect URI was still different.
cococococococo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.