acquireTokenSilent fails to return or throw an exception. (when used in Coil's ImageRequest). #1898
Labels
Inevstigation
Engineering team as looked into the issue and needs deeper investigation to provide a conclusion
Describe the bug
I need to load an image that requires a Bearer token as a request header. When I try to retrieve the token from MSAL, the call never returns, and does not throw an exception either. This forces me to cache the token in my app, and used a cached, possibly expired token when I request the image.
Smartphone (please complete the following information):
I don't think any of these parameters matter, but I tested on:
Stacktrace
Application Not Responding error happens.
To Reproduce
Steps to reproduce the behavior:
Have an AsyncImage in your Jetpack Compose layout:
The MSALAuth.getToken() method is:
If related to user experience, use the format:
If related to development, please provide relevant configuration details necessary to understand your problem including any relevant traces, logs, or otherwise.
Expected behavior
A token should be returned, or exception thrown if interactive auth is required.
Actual Behavior
The application will get a not responding error.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I have created a simple project that can reproduce this (with proper Azure setup), and attached. In order to finish configuring, add the correct values in:
SilentTokenHang.zip
Please note: Do not include sensitive information like PII, OII, credentials, secrets, and tokens.
For privacy/security issues please see instructions here
The text was updated successfully, but these errors were encountered: