-
Notifications
You must be signed in to change notification settings - Fork 92
Conversation
When I first loaded the solution, I got a brown banner at the top that said "one or more projects have changes that cannot be resolved by the project manager. Reload projects" - the "Todo.Uno.Mobile" project had errors related to missing targets. Clicking the "Reload projects" solved the problem. Is this something we can do for the user, or do I need to instruct the user to do this? |
Solved the MSAL issues (including the TFM stuff) by simplifying the PublicClientApplicationBuilder to the following, and switching to Uno.WinUI.MSAL: #if ANDROID || IOS
string redirectUri = $"msal{Constants.ApplicationId}://auth";
#else
string redirectUri = "https://login.microsoftonline.com/common/oauth2/nativeclient";
#endif
_identityClient = PublicClientApplicationBuilder
.Create(Constants.ApplicationId)
.WithAuthority(AzureCloudInstance.AzurePublic, "common")
.WithRedirectUri(redirectUri)
.WithUnoHelpers()
.Build(); New error during build: 3>obj\Debug\net7.0-android\android\AndroidManifest.xml : warning XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-33\optional\androidx.window.extensions.jar My AndroidManifest.xml looks like this: <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity android:name="microsoft.identity.client.BrowserTabActivity" android:configChanges="orientation|screenSize" android:exported="true">
<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="msal2160b3eb-9ce1-4d3a-abc0-d37a45cd2e59" android:host="auth" />
</intent-filter>
</activity>
</application>
</manifest> And MainActivity.Android.cs looks like this: using Android.App;
using Android.Content;
using Android.Views;
using Microsoft.Identity.Client;
namespace TodoApp.Uno
{
[Activity(
MainLauncher = true,
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
WindowSoftInputMode = SoftInput.AdjustPan | SoftInput.StateHidden
)]
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
{
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs(requestCode, resultCode, data);
}
}
} |
There doesn't seem to be a workaround for this at the moment, so just need to flag as known warning for the user |
Yes, Uno.WinUI.MSAL is the main fix for getting auth to work. I'll send you the details |
No description provided.