This commit is contained in:
2019-10-01 18:28:47 +00:00
parent ef3397c421
commit 9c5a0f2ae1
3 changed files with 25 additions and 6 deletions

4
.vscode/launch.json vendored
View File

@@ -35,8 +35,8 @@
"action": "openExternally",
//"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+http://\\S+:([0-9]+)",
"uriFormat": "http://localhost:%s/start/"
"pattern": "^\\s*Now listening on:\\s+https://\\S+:([0-9]+)",
"uriFormat": "https://localhost:%s/start/222"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"

View File

@@ -20,7 +20,7 @@ namespace qbridge.Controllers
public const string CLIENT_SECRET = "XUmJyvEcEuwQuyhARUAm0a8G3gzbEAeMiATCLyFZ";
#if (DEBUG)
public const string REDIRECT_URI = "https://localhost:5001/redirect";
public const string REDIRECT_URI = "https://localhost:3003/redirect";
#else
public const string REDIRECT_URI = "https://qboauth.ayanova.com/redirect";
#endif
@@ -70,7 +70,7 @@ namespace qbridge.Controllers
{
_clientFactory = clientFactory;
}
@@ -181,7 +181,22 @@ namespace qbridge.Controllers
AccessTokenObject = null;
}
return Content($"TOKEN: {AccessTokenObject.ToString()}");
var refresh_token = AccessTokenObject["refresh_token"].Value<string>();
var access_token = AccessTokenObject["access_token"].Value<string>();
var x_refresh_token_expires_in = AccessTokenObject["x_refresh_token_expires_in"].Value<long>();
var access_token_expires_in = AccessTokenObject["expires_in"].Value<long>();
return Ok(new
{
access_token = access_token,
access_token_expires_in = access_token_expires_in,
refresh_token = refresh_token,
x_refresh_token_expires_in = x_refresh_token_expires_in,
realmId = realmId,
code = code
});
//return Content($"ACCESS TOKEN: {access_token}, REFRESH TOKEN: {refresh_token}, REALM:{realmId}, STATE:{state}, CODE:{code}");
/*
Actual response example:

View File

@@ -12,7 +12,11 @@ namespace qbridge
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
#if (DEBUG)
.UseUrls("https://*:3003")
#else
.UseUrls("http://*:3003")
.UseStartup<Startup>();
#endif
.UseStartup<Startup>();
}
}