microsoft-authentication-library-for-dotnet
microsoft-authentication-library-for-dotnet copied to clipboard
[Bug] OnActivityResult not called when calling AcquireTokenInteractive from Share
Which Version of MSAL are you using ? Note that to get help, you need to run the latest version. Preview version are also ok. For ADAL, please log issues to https://github.com/AzureAD/azure-activedirectory-library-for-dotnet MSAL 4.7.0
Platform Xamarin.Android
What authentication flow has the issue?
- Desktop / Mobile
- [X] Interactive
- [ ] Integrated Windows Auth
- [ ] Username Password
- [ ] Device code flow (browserless)
- Web App
- [ ] Authorization code
- [ ] OBO
- Web API
- [ ] OBO
Other? - please describe;
Is this a new or existing app? This is a new app.
Repro I have the app where i have an IntentFilter on MainActivity so I can Share for example an URL from the browser to my app. When the user has installed the app and shared a link to the app, but isn't signed in. First thing I would call is the PCA.AcquireTokenInteractive() method. In the normal flow this is working correct. However when it's called from the Share request it will open the browser, login and returns to (I think it is) the BrowserTabActivity. But further nothing happens. The activity stays on the screen and OnActivityResult is not called.
Sharing the url is done by opening the browser, press the 3 dots at the top and choose Share. In the list of apps choose this app to share the URL.
Expected behavior OnActivityResult is called and the BrowserTabActivity is closed.
Actual behavior See repro steps above.
Additional context/ Logs / Screenshots Attached the sample project with the Share IntentFilter added to the MainActivity and the OnResume method with the call to the PCA.AcquireTokenInteractive() method.
I have exactly the same problem. Launched from the application drawer the application works fine but launched from a link the OnActivityResult it isn't called. I'm with a Xamarin Forms application.
I have filled the same question in Stackoverflow. There is the code on my MainActivity.
Did some more investigation by overriding the BrowserTabActivity. But didn't find a solution yet. One difference I noticed from the 'default' flow, versus the 'Share' flow is that the OnResume method in the BrowserTabActivity is called twice. Parameters in the Intent are exactly the same.
Also tried to clone this repository and try to find out, but building the 'share' scenario didn't work out as I expected.
Is there any news from someone else?
I can see the same issue on ADAL 4.1.0. is the fix for this issue found?
This is very old issue, and we are not able to repro. Please move to use Maui and open a new bug if the problem still occurs.