Auth0 Home Blog Docs

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

lock
auth0-lock
ios
swift
lock-for-ios
#1

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) {

    app.staticTexts["notLoggedInActivelabel"].tap()

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

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

#3

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!

closed #4

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

opened #5
#7

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 https://developer.apple.com/documentation/safariservices/sfauthenticationsession) 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!

#9

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!

closed #10

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