Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict Internal Login Browser / Window to Portrait mode #1244

Closed
stezma opened this issue Jul 1, 2019 · 3 comments
Closed

Restrict Internal Login Browser / Window to Portrait mode #1244

stezma opened this issue Jul 1, 2019 · 3 comments
Assignees
Milestone

Comments

@stezma
Copy link

stezma commented Jul 1, 2019

Library - Microsoft.Idendity.Client (V) 4.0.0
Platform - Xamarin Forms.

In my app I am using Embedded WebView for login ( .WithUseEmbeddedWebView(true)). The issue I am facing here is,
I am restricting my app to work only on Portrait Mode through code. But even though I restrict it through code, Only on login WebView(Embedded WebView) it is not working. The orientation is not locked for Azure AD B2C login Page.
Along with that,

After typing the user name Password, if the orientation changes it clears the text fields that already filled. Which is quite annoying.

Please Fix.!!!!

This is the code i am using

Method to Sign-In

 private async Task<UserContext> SignInInteractively()
        {
            IEnumerable<IAccount> accounts = await PCA.GetAccountsAsync();
            AuthenticationResult ar = await PCA.AcquireTokenInteractive(B2CConstants.Scopes)
                .WithAccount(GetAccountByPolicy(accounts, B2CConstants.PolicySignUpSignIn))
                .WithParentActivityOrWindow(ParentActivityOrWindow)
                .WithUseEmbeddedWebView(true)
                .ExecuteAsync();

            var newContext = UpdateUserInfo(ar);
            return newContext;
        }

Restricting the orientation

 [Activity(Label = "UserDetailsClient",
        Icon = "@drawable/icon",
        Theme = "@style/MyTheme",
        MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, ScreenOrientation = ScreenOrientation.Portrait)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {
@jennyf19
Copy link
Collaborator

jennyf19 commented Aug 8, 2019

@stezma this has been fixed and is in master branch. Feel free to verify. Will be in next release.

@bgavrilMS
Copy link
Member

Fixed in MSAL 4.3.1

@rkshnair
Copy link

@bgavrilMS @jennyf19
Is it possible to lock the orientation of Embedded WebView in this release. I can see the username / password clearing issue has been resolved. What about orientation?

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

No branches or pull requests

5 participants