Я добавил следующий код для Android
Код: Выделить всё
using Android.Content;
using Android.App;
using Android.Content.PM;
namespace abc.Mobile;
[Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop, Exported = true)]
[IntentFilter(new[] { Intent.ActionView },
Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
DataScheme = CALLBACK_SCHEME)]
public class WebAuthenticationCallbackActivity : Microsoft.Maui.Authentication.WebAuthenticatorCallbackActivity
{
const string CALLBACK_SCHEME = "com.abc";
}
Код: Выделить всё
var authenticationService = new Auth0Client(new() {
Domain = "",
ClientId = Preferences.Get("ClientId", "xxx"), //Client Id from Auth0 portal
RedirectUri = "com.abc://callback/",
PostLogoutRedirectUri = "com.abc://callback/",
Scope = "openid offline_access"
});
authenticationResult = await authenticationService.LoginAsync(new {
audience = xxx, // Audience from Auth0 portal
prompt = "select_account"
});
Вы должны создать подкласс WebAuthenticatorCallbackActivity
Вы должны создать подкласс WebAuthenticatorCallbackActivity
code> и создайте для него IntentFilter, соответствующий вашему callbackUrl.
Подробнее здесь: https://stackoverflow.com/questions/787 ... ui-android
Мобильная версия