AzureAD / microsoft-authentication-library-for-dotnet

Microsoft Authentication Library (MSAL) for .NET
https://aka.ms/msal-net
MIT License
1.39k stars 340 forks source link

MSAL Android - App was stuck at callback screen #4000

Open Nguyenthanhtoa opened 1 year ago

Nguyenthanhtoa commented 1 year ago

I implemented MSAL authentication on Android using Xamarin with package Microsoft.Identity.Client and it has an issue at callback screen, the authentication was successully and the token was granted but the application was stuck in callback screen. When I zoom out or rotate my device to landscape it show a "continue" button, if I pressed that button, the authentication process will complete and can callback to my app.

This problem only occurred on some android device models, so I'm not sure why the UI/UX here is incorrect. Can you please give me an advise. Thank you! 1 2 3

negoe commented 1 year ago

@Nguyenthanhtoa The right place for filing this issue would be Microsoft.Identity.Client.

@jmprieur @jennyf19 , Can you please help here?

jmprieur commented 1 year ago

@SameerK-MSFT

bgavrilMS commented 1 year ago

@trwalke - can you provide a perspective please?

trwalke commented 1 year ago

Looks to me like the AAD sign in page is causing this UI issue. Seems like it is failing to render the page correctly. Which version of android is used here? Also, which browser is being used for the devices that fails vs the devices that work?

Nguyenthanhtoa commented 1 year ago

Hi @trwalke, I agree with you about that "Seems like it is failing to render the page correctly", I affraid that this issue may be related to MFA approve method or browser rendering method. I use Android 13 and MS Edge to login (I also tried with Chrome but still get the same error).

trwalke commented 1 year ago

Ok, if it is failing with multiple browsers and it works fine on some phones and not others, it seems like an external issue with the AAD login page. Probably something to do with the user agent but not sure @bgavrilMS.

Nguyenthanhtoa commented 1 year ago

FYI @trwalke @bgavrilMS After receiving MFA approve notification request, if I ignore that notification and try to open Authenticator app and approve manually. The message and continue button will not appear and I can login app successfully.

MFA

Nguyenthanhtoa commented 1 year ago

Hi @trwalke @bgavrilMS, do you have any update on it?

trwalke commented 1 year ago

@bgavrilMS do you know someone from ESTS we can contact for this?

SameerK-MSFT commented 1 year ago

@Nguyenthanhtoa have you tried with MAUI? Does it work on MAUI?

Also what is the make and model of the Phone? What version of Xamarin/Forms do you use?

Nguyenthanhtoa commented 1 year ago

Hi @SameerK-MSFT sam, No, I haven't. I'm not sure it work on MAUI because our project using Xamarin.Android (not Xamarin.Forms). The phone model is Samsung S10 with Android version 13. I use Microsoft.Identity.Client v4.43.2 and the application use MS Edge or Chrome as external browser to authente with Azure AD.

softlion commented 8 months ago

I get this issue on both the Android simulator and a pixel 5 device, using MAUI 8.0.7 and Xamarin.AndroidX.Fragment.Ktx 1.6.2.2 (required to fix compilation issue).

On the same simulator using Xamarin Forms, it is working as expected.