|
@@ -937,31 +937,9 @@ namespace TEAMModelOS.Controllers
|
|
|
[Authorize(Roles = "IES")]
|
|
|
public async Task<IActionResult> GetUserFromCoreID(JsonElement request)
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
var content = new StringContent(request.ToString(), Encoding.UTF8, "application/json");
|
|
|
- string a = await _coreAPIHttpService.GetUserInfos(content);
|
|
|
- return Ok(a.ToObject<JsonElement>());
|
|
|
- try
|
|
|
- {
|
|
|
- string url = _configuration.GetValue<string>("HaBookAuth:CoreId:userinfo");
|
|
|
- HttpClient client = new HttpClient();
|
|
|
- // var content = new StringContent(request.ToString(), Encoding.UTF8, "application/json");
|
|
|
- HttpResponseMessage responseMessage = await client.PostAsync(url, content);
|
|
|
- if(responseMessage.StatusCode == HttpStatusCode.OK)
|
|
|
- {
|
|
|
- string responseBody = responseMessage.Content.ReadAsStringAsync().Result;
|
|
|
- return Ok(responseBody);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return BadRequest();
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- return BadRequest();
|
|
|
- }
|
|
|
+ string json = await _coreAPIHttpService.GetUserInfos(content);
|
|
|
+ return Ok(json.ToObject<JsonElement>());
|
|
|
}
|
|
|
}
|
|
|
}
|