So, i'm currently developing a XamarinForms application with IOS and Android support and Implement openidict for authentication flows.
It turns out that on IOS when opening the browser it prompts with a Dialog first.
While using Xamarin Essentials
In order to disable this dialog one must set PrefersEphemeralWebBrowserSession = true in the WebAuthenticatorOptions as shown below.
var url = new Uri("https://mysite.com/mobileauth/Microsoft");
var callbackUrl = new Uri("myapp://");
var authResult = await WebAuthenticator.AuthenticateAsync(new WebAuthenticatorOptions
{
Url = url,
CallbackUrl = callbackUrl,
PrefersEphemeralWebBrowserSession = true
});
I have not tested with anything other than IOS simulators and physical IOS devices.
Hope this helps anyone that tries to find a way to do this as I have found a few people out there asking this question.
Top comments (1)
Thanks, this really helped!