diff --git a/.vscode/launch.json b/.vscode/launch.json index 1285f10..5771db6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -36,7 +36,7 @@ //"pattern": "^\\s*Now listening on:\\s+(https?://\\S+)", //https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#specifying-the-browsers-url "pattern": "^\\s*Now listening on:\\s+https://\\S+:([0-9]+)", - "uriFormat": "https://localhost:%s/start/222" + "uriFormat": "https://localhost:%s/start/2827706062985642634" }, "env": { "ASPNETCORE_ENVIRONMENT": "Development" diff --git a/Controllers/AuthController.cs b/Controllers/AuthController.cs index 889e5be..3cbb74b 100644 --- a/Controllers/AuthController.cs +++ b/Controllers/AuthController.cs @@ -1,12 +1,9 @@ +using System; using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using System.Net.Http; using Newtonsoft.Json.Linq; -using Newtonsoft.Json; -using System.Net.Http.Formatting; namespace qbridge.Controllers { @@ -128,7 +125,7 @@ namespace qbridge.Controllers // Redirect endpoint //Step 4 here: https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/openid-connect [HttpGet("redirect")] - public async Task GetAsync([FromQuery]string state, [FromQuery]string code, [FromQuery]string realmId) + public async Task GetAsync([FromQuery] string state, [FromQuery]string code, [FromQuery]string realmId) { //NOTE: state is our own state provided in the initial auth redirect //code is authorization code used to then get the refresh and access token @@ -194,7 +191,8 @@ namespace qbridge.Controllers refresh_token = refresh_token, x_refresh_token_expires_in = x_refresh_token_expires_in, realmId = realmId, - code = code + code = code, + state = state }); //return Content($"ACCESS TOKEN: {access_token}, REFRESH TOKEN: {refresh_token}, REALM:{realmId}, STATE:{state}, CODE:{code}");