<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Paulo Carvalho</title>
    <description>The latest articles on DEV Community by Paulo Carvalho (@paulo_carvalho).</description>
    <link>https://dev.to/paulo_carvalho</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F628061%2F8a63e4c4-4d7e-4ab8-84c2-d8837f89b46e.png</url>
      <title>DEV Community: Paulo Carvalho</title>
      <link>https://dev.to/paulo_carvalho</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paulo_carvalho"/>
    <language>en</language>
    <item>
      <title>Disable the Dialog Prompt from IOS when implementing Xamarin Essentials Web Authenticator</title>
      <dc:creator>Paulo Carvalho</dc:creator>
      <pubDate>Tue, 08 Mar 2022 21:20:36 +0000</pubDate>
      <link>https://dev.to/paulo_carvalho/disable-the-dialog-prompt-from-ios-when-implementing-xamarin-essentials-web-authenticator-230f</link>
      <guid>https://dev.to/paulo_carvalho/disable-the-dialog-prompt-from-ios-when-implementing-xamarin-essentials-web-authenticator-230f</guid>
      <description>&lt;p&gt;So, i'm currently developing a &lt;a href="https://dotnet.microsoft.com/en-us/apps/xamarin/xamarin-forms"&gt;XamarinForms&lt;/a&gt; application with IOS and Android support and Implement &lt;a href="https://github.com/openiddict/openiddict-core"&gt;openidict&lt;/a&gt; for authentication flows.&lt;br&gt;
It turns out that on IOS when opening the browser it prompts with a Dialog first.&lt;br&gt;
While using &lt;a href="https://docs.microsoft.com/en-gb/xamarin/essentials/"&gt;Xamarin Essentials&lt;/a&gt;&lt;br&gt;
In order to disable this dialog one must set PrefersEphemeralWebBrowserSession = true in the WebAuthenticatorOptions as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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
    });

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have not tested with anything other than IOS simulators and physical IOS devices.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

</description>
      <category>xamarinforms</category>
      <category>ios</category>
      <category>dotnet</category>
      <category>openid</category>
    </item>
  </channel>
</rss>
