Problem on getting user data with C# library

Hello, I am developing a Web App where I use Auth0.com for user authentication and authorization. It’s working great, but I’m having a problem getting the user data. My project is Blazor Wasm and I’m using the client library for C#. In the controller the request is correct and it shows me all the fields, but when I read the results in the razor page (Client) they are null. I have no error message or anything. I honestly don’t know what else to try. I leave the methods used and images.

Library: C#
Versión: 7.12

Server side

[HttpGet("GetUsuarioByEmail")]
        public async Task<ActionResult> GetUsuarioByEmail(string estudioId, string email)
        {
            var token = await _tokenService.GetTokenAuth0Async(estudioId);

            IList<User> profile = new List<User>();
            try
            {

                var client = new ManagementApiClient(token, _auth0Configuracion.Domain);
                
                profile = await client.Users.GetUsersByEmailAsync(email);

                return Ok(profile);
            }
            catch (Exception ex)
            {
               //Log error
                return BadRequest(ex.Message);
            }
}

Image of the breakpoint on return Ok(profile)

Client Side

var requestUsuario = await Http.GetAsync(url);
 if (requestUsuario.IsSuccessStatusCode)
 {
            var lectura = await requestUsuario.Content.ReadAsStringAsync();
            usuariosAuth0 = JsonConvert.DeserializeObject<List<Auth0.ManagementApi.Models.User>>(lectura);
 }
 else
 {
            errorCarga = $"Error al cargar datos del Usuario {requestUsuario.ReasonPhrase}";
 }

The image of the breakpoint in usuariosAuth0

I tried it with the API, but with the same result.
Could you help me? Is there an error in the code that I’m not seeing?
Regards

Well, clearly yesterday was too late to think. I was able to fix it. The request made from the client side was wrong. I changed it to this and it works fine

usuariosAuth0 = await Http.GetFromJsonAsync<Auth0.ManagementApi.Models.User>(url);

I hope it can be useful to someone in the future.

Wooohooo thanks for sharing it with the rest of community!

I putted the solution. You have to change the request method. Replace await Http.GetAsync(url); to await Http.GetFromJsonAsync<Auth0.ManagementApi.Models.User>(url);

1 Like

Woooohooo! Thanks for sharing with the rest of community!