Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor app hangs after request MS Graph Me.GetAsync()

$
0
0

I'm doing a simple call to the Me endpoint. If I step through to await graphClient.Me.GetAsync() that line, it jumps out to the calling method and the browser is just spinning. It seems to me that Graph is throwing an exception but it must be swallowing it because nothing is caught.

  • My app has user.read permissions in the App Registration.
  • I'm passing in a valid graphClient object.
  • I'm able to connect and get a response from Postman.

Any suggestions why this is happening

Here's the method:

public async Task<User> GetGraphMeAsync(GraphServiceClient graphClient){    try    {        var graphUser = await graphClient.Me.GetAsync().ConfigureAwait(false);        if(graphUser != null)              return graphUser;        else { return new User(); }    }    catch (Exception ex)    {        throw new Exception(ex.Message);     }}

I'm calling it from OnInitialeAsync() of the same component.

        protected override async Task OnInitializedAsync()        {            var graphClient = GetGraphClient();            var meData = await GetGraphMeAsync(graphClient).ConfigureAwait(false);        }

My next test is to switch from the SDK to the API.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>