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

Android project won't redirect back to app #47

Closed
kcorrea96 opened this issue Mar 21, 2018 · 7 comments
Closed

Android project won't redirect back to app #47

kcorrea96 opened this issue Mar 21, 2018 · 7 comments

Comments

@kcorrea96
Copy link

kcorrea96 commented Mar 21, 2018

I'm a bit new to Azure & Xamarin.Forms and am trying to build a simple login application. I've gone through this tutorial multiple times and can't help but feel like I'm missing something. My application successfully brings me to the login page & allows me to enter my credentials, but when I click login it brings me to a blank screen (as seen below).

screen shot 2018-03-21 at 7 50 26 pm

My android manifest looks like:

<uses-sdk android:minSdkVersion="25" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application> <activity android:name="microsoft.identity.client.BrowserTabActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="msal{app-id-of-native-aad-application}" android:host="auth" /> </intent-filter> </activity> </application> </manifest>

The redirect URI of my native app is set to msal{app-id-of-native-aad-application}://auth and the reply URI of my api (though from what i've seen this doesn't really matter) is set to https://localhost:44316/

I've changed the variables in the PCL as follows:

public static readonly string Tenant = "qalog.onmicrosoft.com"; // Domain/resource name from AD B2C
        public static readonly string ClientID = "{app-id-of-native-aad-application}"; // Application ID from AD B2C
        public static string PolicySignUpSignIn = "B2C_1_LoginApp"; // Policy name from AD B2C
        public static string PolicyEditProfile = "B2C_1_EditProf";
        public static string PolicyResetPassword = "B2C_1_ResetPass";

        public static readonly string[] Scopes = { "https://qalog.onmicrosoft.com/api/read", "https://qalog.onmicrosoft.com/api/user_impersonation"}; // Leave blank unless additional scopes have been added to AD B2C
        public static string ApiEndpoint = "https://fabrikamb2chello.azurewebsites.net/hello";

        public static string AuthorityBase = $"https://login.microsoftonline.com/tfp/{Tenant}/"; // Doesn't require editing
        public static string Authority = $"{AuthorityBase}{PolicySignUpSignIn}"; // Doesn't require editing

Am I missing something/does anyone have suggestions?

@jennyf19
Copy link
Contributor

jennyf19 commented May 1, 2018

@kcorrea96 were you able to get the sample running as-in, without changing any of the properties?

@Livven
Copy link

Livven commented Jul 11, 2018

I have Firefox set as my default browser and get the same blank screen after login and redirect if I choose "Open in Firefox" in the internal browser. It works if I stay in the internal browser or set Chrome as default and then open in an external Chrome instance.

@jennyf19
Copy link
Contributor

@Livven @kcorrea96 Right now, MSAL has to have Chrome or Chrome custom tabs installed on the device in order to show the UI. We have embedded webview support coming, and you can try it out here and give us feedback and suggestions.

@jennyf19
Copy link
Contributor

Any update on this @Livven @kcorrea96 ?

We now have the option for embedded webview in MSAL (which does not require custom tabs)...please check out the MSALv2.0.1-preview release.

We would love your feedback as well. You can reach me directly or open an issue on the MSAL repo.
Thanks!

@Livven
Copy link

Livven commented Sep 17, 2018

@jennyf19 Thanks for the follow-up! Think it should solve AzureAD/microsoft-authentication-library-for-dotnet#589 as well too. I'll let you know if it works out.

@raasmasood
Copy link

just pass true in UIParent that tells android to use embedded browser.

App.UiParent = new UIParent(this, true);

@jennyf19
Copy link
Contributor

@kcorrea96 @Livven @raasmasood Closing as the issue is resolved.Thank you

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

No branches or pull requests

4 participants