Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Login Screen Loses Provided User Email on Device Orientation in Android #1622

Closed
dinobu opened this issue Jun 30, 2019 · 15 comments
Closed

Login Screen Loses Provided User Email on Device Orientation in Android #1622

dinobu opened this issue Jun 30, 2019 · 15 comments

Comments

@dinobu
Copy link

dinobu commented Jun 30, 2019

I have Xamarin.Forms application that authenticates user against Azure AAD. That all works fine but on Android, device orientation looses user email on the Microsoft authentication screen.

Here, my device is in Portrait mode and I have entered user email:

Screenshot_20190630-093043

If I enter user email and click on Next, I land on screen prompting me to enter password. If I now rotate device on Android, it will return me back to the screen above but notice, the screen has lost my previously entered user email, it is blank now

Screenshot_20190630-093002

This is not happening on IOS devices, only Android. Device rotation should not return me back to screen prompting for user email not should it loose that information. Similarly, If I have entered password half way through and device is rotated, I should be just able to continue entering the rest of my password.

How do I prevent the rotation on this Sign in screen from loosing already entered user name and re-prompting for it? I dont want to disable rotation.

My MainActivity has already ConfigChages.Orientation attribute like below:

[Activity(Name = "my.mainactivity"
, Label = "MyApp"
, Icon = "@drawable/icon"
, ConfigurationChanges = ConfigChanges.ScreenSize 
    | ConfigChanges.SmallestScreenSize 
    | ConfigChanges.ScreenLayout 
    | ConfigChanges.Orientation)]
public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
   ...
}

, but this is not resolving the issue and I think the reason is that AcquireTokenAsync is probably using WebView which refreshes itself on device rotation on Android. How do I prevent this? I dont think your API provides a way around this which is very annoying issue on mobile devices.

@bgavrilMS
Copy link
Member

No new features will be implemented on ADAL. The team's efforts are on improving MSAL, the next-gen auth library. MSAL's wiki contains a migration guide from ADAL.

Only regressions, high severity issues and security issues will be fixed on ADAL. Other issues are likely to have already been fixed in MSAL. If not, please log them and the team will prioritise them.

@henrik-me
Copy link
Contributor

@dinobu : We may have to address the same type of issue in MSAL, thus pls. open the issue there. We believe it's relatively simple to move from ADAL to MSAL however should you need assistance we are happy to help.

@jennyf19
Copy link
Contributor

jennyf19 commented Jul 1, 2019

@dinobu I am able to reproduce the issue in MSAL. would you mind opening an issue there? thanks.

cc: @henrik-me

@jennyf19
Copy link
Contributor

jennyf19 commented Jul 1, 2019

I'll link this issue, as, I think, they are related.

@dinobu
Copy link
Author

dinobu commented Jul 4, 2019

I'll link this issue, as, I think, they are related.

Thank you @jennyf19

@henrik-me
Copy link
Contributor

@dinobu : We would like to make this experience better. What is preventing you from moving to MSAL?

@dinobu
Copy link
Author

dinobu commented Jul 5, 2019

@dinobu : We would like to make this experience better. What is preventing you from moving to MSAL?

No plans to move to MSAL but we are using Xamarin.Forms app (all 3 platforms) to authenticate with AzureAD, if you can provide me good guide to move to MSAL, I will take a look. But again, this is not planned to do, it is just my personal interest that I would like to take a look. We still need the ADAL fix.

@jennyf19
Copy link
Contributor

jennyf19 commented Jul 5, 2019

@dinobu Here's an overview of differences between ADAL and MSAL and also benefits of Microsoft identity platform v2.

@dinobu
Copy link
Author

dinobu commented Jul 5, 2019

@dinobu Here's an overview of differences between ADAL and MSAL and also benefits of Microsoft identity platform v2.

Thanks, I have already read both of these but will still take another look. Much appreciated.

@jennyf19
Copy link
Contributor

jennyf19 commented Jul 5, 2019

@dinobu Great...if you have any questions, let us know.

@dinobu
Copy link
Author

dinobu commented Aug 7, 2019

Any movement on the hot fix for ADAL to resolve this issue?

@bgavrilMS
Copy link
Member

Sorry @dinobu , but this is not a regression and we will not fix this in ADAL. I am not sure when we'll be able to take a look at it in MSAL, but feel free to propose smth if you are so inclined. We accept contributions.

@jennyf19
Copy link
Contributor

jennyf19 commented Aug 8, 2019

@dinobu this fix will be in the 5.1.1 release, which will be out this week. Fix is also in MSAL and will be in next MSAL release.

@dinobu
Copy link
Author

dinobu commented Aug 8, 2019

@dinobu this fix will be in the 5.1.1 release, which will be out this week. Fix is also in MSAL and will be in next MSAL release.

Thanks again, will grab ADAL 5.1.1 once released. Much appreciated @jennyf19

@jennyf19
Copy link
Contributor

jennyf19 commented Aug 8, 2019

Included in 5.1.1 release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants