[Bug] WebAuthenticator -> You must subclass the `WebAuthenticatorCallbackActivity` and create an IntentFilter for it which matches your `callbackUrl`.
Bug report best practices: Submitting Issues
Description
Steps to Reproduce
- use "xamarinessentials://ABC" in the WebAuthenticationCallbackActivity subclass
- use "xamarinessentials://ABC" in the webauthenticator.authenticationasync callback uri
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.
Basic Information
-
Version with issue:
-
Last known good version: unknown
-
IDE: Visual studio for mac
-
Platform Target Frameworks: android
- iOS:
- Android: API 29
- UWP:
-
Android Support Library Version:
-
Nuget Packages: xamarin essentials
-
Affected Devices:
Screenshots
Reproduction Link
This is an example for the data scheme directly from the sample which work sout of the box.
[Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop)]
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "xamarinessentials")]
public class WebAuthenticationCallbackActivity : Xamarin.Essentials.WebAuthenticatorCallbackActivity
{
}
and then: https://github.com/xamarin/Essentials/blob/main/Samples/Samples/ViewModel/WebAuthenticatorViewModel.cs#L58-L61
try it without your ABC
hi @jamesmontemagno,
In the Webauthenticator.Authenticateasync method, the 2nd parameter is a callbackuri, the callbackuri to be inputted there is the one we registered in the backend side? or it will not matter since we already added the registered callbackuri in the authorizeurl passed in the 1st paramete?