XCTestCase: How to dismiss security alert “XXXX” Wants to Use “auth0.com”

So recently Apple introduced this prompt: “XXXX” Wants to Use “auth0.com” to Sign In
Where “XXXX” is the ios app name.

This alert/dialog comes up when in the case of Auth0 the user clicks on “Login with Google” or “Login with Facebook”. That’s all nice but when running IOS UI tests, this dialog doesn’t go away when using the usual way of dismissing system dialogs:

func doUserLogin(_ app: XCUIApplication) {


    let handler = self.addUIInterruptionMonitor (withDescription: "allow oauth") { (alert) -> Bool in
        return true
    app.scrollViews.otherElements.buttons["LOG IN WITH GOOGLE"].tap()

Woulkd anyone know how to dismiss this dialog in an XCTestCase?

Hey there @christoforosl08,

As it has been more than a few months since this topic was opened and there has been no reply or further information provided from the community as to the existence of the issue we would like to check if you are still facing the described challenge?

We are more than happy to assist in any way! If the issue is still out there please let us know so we can create a new thread for better visibility, otherwise we’ll close this one in week’s time.

Thank you!

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

I wanted to follow up with you @christoforosl08 in regards to your question on the alert prompt that is still occurring. We had a similar question in Community that @Abhishek_Hingnikar1 gave great insight on here.

To recap he says:

The dialog is shown when ASWebAuthenticationSession (or the older SFAuthenticationSession SFAuthenticationSession | Apple Developer Documentation) is invoked, its an apple enforced popup in order to allow the application the ability to access cookies that are owned by the system shared browser (safari). The goal of this API from apple is to allow identity providers to utilize web based session controls. The only case this prompt will not happen is if you open SFSafariViewController instead, which looks visibly different (looks more like a safari web view instead of a immutable header on top that can be used only to login).

You can learn more about AFWebAuthenticationSession at https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession in short the purpose of this prompt is to protect user’s privacy. Once Custom Domains is set this will allow you to prompt for your domain , therefore the app will show something like YourApp would like to Access YourApp.com in order to login.

Please let me know if this helps clarify the situation. Thanks in advance!

After reviewing the StackOverflow response you received @christoforosl08, it looks like a good shot to accomplish what you are after. I would recommend giving it a test and seeing if it performs the way we anticipate. Please let us know how it all turns out, Thanks!

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