title: How to solve redirect_uri_mismatch i ASP.NET MVC?
body: <p>I have created ASP.NET MVC web application to integrate with google calendar API.</p>
  <p>I have followed the  documentation in Google sites. I have set up the project in Google Developer console as follows:</p>
  <p><a href="https://i.stack.imgur.com/Hy2jb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hy2jb.png" alt="enter image description here" /></a></p>
  <p>I have also downloaded the credentials files after creating the project but while using it i am getting <code>uri_mismatch</code> error every time.</p>
  <p><a href="https://i.stack.imgur.com/n4nkP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n4nkP.png" alt="enter image description here" /></a></p>
  <p>How can this be solved?</p>
  <p>My code for authorization is :</p>
  <pre><code>string jsonFile = HttpContext.Server.MapPath(&quot;~/credentials.json&quot;);
  
              UserCredential credential;
  
              using (var stream =
                  new FileStream(jsonFile, FileMode.Open, FileAccess.Read))
              {
                  // The file token.json stores the user's access and refresh tokens, and is created
                  // automatically when the authorization flow completes for the first time.
                  //string credPath = &quot;token.json&quot;;
                  string credPath = HttpContext.Server.MapPath(&quot;~/token&quot;);
                  credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                      GoogleClientSecrets.Load(stream).Secrets,
                      Scopes,
                      &quot;user&quot;,
                      CancellationToken.None,
                      new FileDataStore(credPath, true)).Result;
                  Console.WriteLine(&quot;Credential file saved to: &quot; + credPath);
              }
  
              // Create Google Calendar API service.
              var service = new CalendarService(new BaseClientService.Initializer()
              {
                  HttpClientInitializer = credential,
                  ApplicationName = ApplicationName,
              });
  
              // Define parameters of request.
              EventsResource.ListRequest request = service.Events.List(&quot;primary&quot;);
              request.TimeMin = DateTime.Now;
              request.ShowDeleted = false;
              request.SingleEvents = true;
              request.MaxResults = 10;
              request.OrderBy = EventsResource.ListRequest.OrderByEnum.StartTime;
  
  </code></pre>