Expected Behavior : app should open website for login

Actual Behavior : error encountered You must subclass the WebAuthenticatorCallbackActivity and create an IntentFilter for it which matches your callbackUrl.

Screenshots :

Error

enter image description here

Subclass

enter image description here

2

There are 2 best solutions below

0
On

You should write DataScheme="xamarinessentials" and DataHost="ABC" as properties into IntentFilterAttribute.

0
On

in MainActivity.cs

[Activity(label="your_app", ....)]
[IntentFilter(new[] { Android.Content.Intent.ActionView },
    Categories = new[] { Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable },
    DataScheme = "your_app")]

var authResult = await WebAuthenticator.AuthenticateAsync(
        new Uri("your_Auth_URL"),
        new Uri("your_app")); //THIS MUST BE SAME AS YOUR DATASCHEME

var accessToken = authResult?.AccessToken;

Source : https://learn.microsoft.com/en-us/xamarin/essentials/web-authenticator?tabs=android#using-webauthenticator