Fix URL doppio x oauth e clients
This commit is contained in:
@@ -34,7 +34,7 @@ namespace MConnectSDK
|
||||
/// <summary>
|
||||
/// URL BASE per le chiamate
|
||||
/// <summary>
|
||||
protected string BaseUrl = @"https://stg.api.maestroconnect.scmgroup.com/";
|
||||
protected string BaseUrl = @"https://stg.api.maestroconnect.scmgroup.com/clients";
|
||||
|
||||
/// <summary>
|
||||
/// ID applicativo/client per piattaforma MaestroConnect (differente per UTE)
|
||||
@@ -61,6 +61,11 @@ namespace MConnectSDK
|
||||
/// <summary>
|
||||
protected memLayer ML;
|
||||
|
||||
/// <summary>
|
||||
/// URL BASE per le chiamate OAuth
|
||||
/// <summary>
|
||||
protected string OAuthUrl = @"https://stg.api.maestroconnect.scmgroup.com/api";
|
||||
|
||||
/// <summary>
|
||||
/// Semaforo ping PRELIMINARE
|
||||
/// </summary>
|
||||
@@ -640,7 +645,7 @@ namespace MConnectSDK
|
||||
private void doTokenStep()
|
||||
{
|
||||
// parametri chiamata
|
||||
Uri callUri = new Uri(BaseUrl + "/oauth2/token");
|
||||
Uri callUri = new Uri(OAuthUrl + "/oauth2/token");
|
||||
// encapsulo clientID
|
||||
var payload = "{\"client_id\": \"" + ClientID + "\"}";
|
||||
HttpContent callCont = new StringContent(payload, Encoding.UTF8, "application/json");
|
||||
@@ -674,7 +679,7 @@ namespace MConnectSDK
|
||||
if (pingOk && cloudOk)
|
||||
{
|
||||
// parametri chiamata
|
||||
Uri callUri = new Uri(BaseUrl + "/oauth2/verification");
|
||||
Uri callUri = new Uri(OAuthUrl + "/oauth2/verification");
|
||||
// !!! FARE fix hard coded !!!
|
||||
var payload = "{\"client_id\": \"" + ClientID + "\", \"device_code\": \"" + tokResp.device_code + "\"}";
|
||||
HttpContent callCont = new StringContent(payload, Encoding.UTF8, "application/json");
|
||||
@@ -776,6 +781,7 @@ namespace MConnectSDK
|
||||
MachineID = config["MachineID"].ToString();
|
||||
ClientID = config["Client_ID"].ToString();
|
||||
// URL base x le chiamate REALI
|
||||
OAuthUrl = config["OAuthUrl"].ToString();
|
||||
BaseUrl = config["BaseUrl"].ToString();
|
||||
WebAppUrl = config["WebAppUrl"].ToString();
|
||||
UploadUrl = config["UploadUrl"].ToString();
|
||||
@@ -852,7 +858,7 @@ namespace MConnectSDK
|
||||
private void refreshAuthToken()
|
||||
{
|
||||
// parametri chiamata
|
||||
Uri callUri = new Uri(BaseUrl + "/oauth2/refresh");
|
||||
Uri callUri = new Uri(OAuthUrl + "/oauth2/refresh");
|
||||
var payload = "{\"refresh_token\": \"" + verifResp.refresh_token + "\"}";
|
||||
HttpContent callCont = new StringContent(payload, Encoding.UTF8, "application/json");
|
||||
|
||||
@@ -1406,7 +1412,7 @@ namespace MConnectSDK
|
||||
if (pingOk && cloudOk)
|
||||
{
|
||||
// provo a chiamare clientInfo...
|
||||
string pageUrl = $"{BaseUrl}/oauth2/clientinfo?access_token={verifResp.access_token}";
|
||||
string pageUrl = $"{OAuthUrl}/oauth2/clientinfo?access_token={verifResp.access_token}";
|
||||
|
||||
var taskRes = Task.Run(() => Utils.getPageAsync(pageUrl));
|
||||
taskRes.Wait();
|
||||
@@ -1464,7 +1470,7 @@ namespace MConnectSDK
|
||||
if (pingOk && cloudOk)
|
||||
{
|
||||
// provo a chiamare clientInfo...
|
||||
string pageUrl = $"{BaseUrl}/oauth2/clientinfo?access_token={verifResp.access_token}";
|
||||
string pageUrl = $"{OAuthUrl}/oauth2/clientinfo?access_token={verifResp.access_token}";
|
||||
|
||||
var taskRes = Task.Run(() => Utils.getPageAsync(pageUrl));
|
||||
taskRes.Wait();
|
||||
|
||||
Reference in New Issue
Block a user