# Problem on getting user data with C# library

**URL:** <https://community.auth0.com/t/problem-on-getting-user-data-with-c-library/77554>\
**Category:** Get Help\
**Created:** [February 3, 2022, 4:10am UTC](https://community.auth0.com/t/problem-on-getting-user-data-with-c-library/77554 "2022-02-03T04:10:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwettstein](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gwettstein/32/20260_2.png) [@gwettstein](https://community.auth0.com/u/gwettstein)\
**Post date:** [February 3, 2022, 4:10am UTC](https://community.auth0.com/t/problem-on-getting-user-data-with-c-library/77554/1 "2022-02-03T04:10:24Z")

</div>

Hello, I am developing a Web App where I use [Auth0.com](http://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**

```auto
[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)`

 ![controller](https://global.discourse-cdn.com/auth0/original/3X/c/6/c67ed54bfc0a96e67cac39d6eecfebfd3621c706.png)

**Client Side**

```auto
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`

 ![cliente](https://global.discourse-cdn.com/auth0/original/3X/d/6/d6f7e75dc6cd0b85f52836f8ad3ce8f88b862c17.png)

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

---

<div class="post-metadata">

**Author:** ![gwettstein](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gwettstein/32/20260_2.png) [@gwettstein](https://community.auth0.com/u/gwettstein)\
**Post date:** [February 3, 2022, 12:47pm UTC](https://community.auth0.com/t/problem-on-getting-user-data-with-c-library/77554/2 "2022-02-03T12:47:03Z")

</div>

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

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

```

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

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 9, 2022, 12:55pm UTC](https://community.auth0.com/t/problem-on-getting-user-data-with-c-library/77554/4 "2022-02-09T12:55:23Z")

</div>

Wooohooo thanks for sharing it with the rest of community!

---

<div class="post-metadata">

**Author:** ![gwettstein](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gwettstein/32/20260_2.png) [@gwettstein](https://community.auth0.com/u/gwettstein)\
**Post date:** [February 9, 2022, 2:24pm UTC](https://community.auth0.com/t/problem-on-getting-user-data-with-c-library/77554/5 "2022-02-09T14:24:18Z")

</div>

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);`

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 10, 2022, 12:48pm UTC](https://community.auth0.com/t/problem-on-getting-user-data-with-c-library/77554/6 "2022-02-10T12:48:28Z")

</div>

Woooohooo! Thanks for sharing with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 22, 2022, 2:43pm UTC](https://community.auth0.com/t/problem-on-getting-user-data-with-c-library/77554/7 "2022-02-22T14:43:09Z")

</div>


