AcquireTokenSilentAsync in iOS App not returning token

Context

I have a Xamarin.Forms app which makes requests to an API using MSAL (Android and iOS version 1.1.4-preview0002). There are two pages which makes requests, and they are structured similarly. On Android, the requests always work, but in iOS, they always work on one page while on the other page, they usually don't work.

After debugging, I've found that it has to do with AcquireTokenSilentAsync. Most of the time, it returns a token with a valid IdToken to be used as the Bearer token for my API requests e.g. when the user logs in or goes to the another page. But when I use it for the page that doesn't work, a timeout exception is raised.

Expected Behavior

AcquireTokenSilentAsync should always return an object with an IdToken that I can use as a bearer token for my API Requests. This should occur on both Android and iOS.

Actual Behavior

AcquireTokenSilentAsync is returning an object with an IdToken most of the time, but when it is on the page that doesn't always work and is on iOS, it usually returns an exception instead.

Answers

Sign In or Register to comment.