# Xamarin iOS disable confirm dialog

**URL:** <https://community.auth0.com/t/xamarin-ios-disable-confirm-dialog/60201>\
**Category:** Get Help\
**Tags:** popup, xamarin, ios, auth0\
**Created:** [March 28, 2021, 6:22am UTC](https://community.auth0.com/t/xamarin-ios-disable-confirm-dialog/60201 "2021-03-28T06:22:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugenio.favalli](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eugenio.favalli/32/16414_2.png) [@eugenio.favalli](https://community.auth0.com/u/eugenio.favalli)\
**Post date:** [March 28, 2021, 6:22am UTC](https://community.auth0.com/t/xamarin-ios-disable-confirm-dialog/60201/1 "2021-03-28T06:22:24Z")

</div>

Hi everyone,  
I have a Xamarin project that will go productive in a month and I have a couple of issues here.

1st I would like to disable the confirm popup like in the screenshot below.  
It’s annoying for the user (and the management) to be asked every single time they login.  
I understand it’s a iOS check but there is a way to improve the UX?

![image](https://global.discourse-cdn.com/auth0/original/3X/9/6/96e3720200f14e5f2fd17667943176e020560f5c.png)

I found a similar issue here:

> [@How to avoid the iOS Permission Alert?](https://community.auth0.com/t/how-to-avoid-the-ios-permission-alert/21975):
>
> Every time when I try to login by opening the Auth0 WebView, I was thrown with the below alert dialog, I am not using any SingleSignOn, I am just configuring to load my login page, that’s it.

But I would never know how to set `useLegacyAuthentication()` in Xamarin.iOS

2nd while searching for an answer the following post raised another concern:

> [@Xamarin iOS app rejected on appstore for using safari auth](https://community.auth0.com/t/xamarin-ios-app-rejected-on-appstore-for-using-safari-auth/14775):
>
> Hi, we have implemented auth0 on a xamarin forms app following the example on github. Unfortunately the app got rejected on the iOS appstore for the following reason: “We noticed that the user is taken to Safari to sign in or register for an account, which provides a poor user experience.” They say a solution would be: “We recommend implementing the Safari View Controller API to display web content within your app.” But I really have no idea to do something like that in Xamarin. Maybe someon…

Is this something I need to take into consideration?

Thanks

---

<div class="post-metadata">

**Author:** ![ricardo.batista](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ricardo.batista/32/7711_2.png) [@ricardo.batista](https://community.auth0.com/u/ricardo.batista)\
**Post date:** [March 29, 2021, 12:23pm UTC](https://community.auth0.com/t/xamarin-ios-disable-confirm-dialog/60201/2 "2021-03-29T12:23:18Z")

</div>

Hi @eugenio.favalli

Indeed, it’s a system alert from the iOS platform itself and cannot be significantly modified. Since you’re using the Universal Login, iOS will trigger this message whenever your app opens the browser to perform authentication.

The only way to disable this alert is by using .useEphemeralSession() to disable SSO for this app in the Auth0.swift library. You can read more about it here: [GitHub - auth0/Auth0.swift: Auth0 SDK for Apple platforms](https://github.com/auth0/Auth0.swift#disable-single-sign-on-ios-13--macos)

Using the .useEphemeralSessions method basically toggles the iOS prefersEphemeralWebBrowserSession to true, which prevents any session data or auth cookies from being shared with the regular browser, as stated in apple’s documentation:

[https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession/3237231-prefersephemeralwebbrowsersessio?language=objc](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession/3237231-prefersephemeralwebbrowsersessio?language=objc)

In this case, since no data is shared, iOS does not prompt the user for consent, but this also prevents any SSO from taking place, as the session cookies cannot be shared across different authentication sessions. If you don’t plan on any SSO this should be completely fine. Do not, however, that if a user is signed in with their social account (google, facebook, etc) in the system browser and they select “Sign in with …” in your app, they’ll be prompted to sign in again in the social provider, as the previous session will not be shared across.

For Xamarin you’ll need to change your Auth0Client object to include the PrefersEphemeralWebBrowserSession parameter as:

```auto
var client = new Auth0Client(new Auth0ClientOptions
 {
    Domain = "YOUR_AUTH0_DOMAIN",
    ClientId = "YOUR_AUTH0_CLIENT_ID",
    Browser = new ASWebAuthenticationSessionBrowser(
        new ASWebAuthenticationSessionOptions
        {
           PrefersEphemeralWebBrowserSession = true
        }
    )
});

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 13, 2021, 12:24pm UTC](https://community.auth0.com/t/xamarin-ios-disable-confirm-dialog/60201/3 "2021-04-13T12:24:11Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
