Lock iOS v1 Passwordless Magic Links
Using Lock v1 for iOS, you can implement a Passwordless login flow using Magic Link authentication for your iOS applications.
iOS needs to know which domains your application handles. To configure this:
- Go to your project's Xcode settings page and open the Capabilities tab.
- Find the Associated Domains section, and move the slider (located near the top right) so that it displays On. This enables the use of Associated Domains.
- Click on the plus sign to add your Auth0 Application's domain. You'll need to use the following format:
Pass callbacks to Lock
AppDelegate class of your iOS application, include the following code to pass callbacks to Auth0 Lock:
Because the Lock library handles the login flow, you'll indicate that it should use a Magic Link. To do this, you'll place the following code into the view controller that presents the Lock login screen:
newEmailViewControllercreates an email login view controller.
truetells the email login view controller to use the Magic Link.
- Because Universal Links do not work on iOS simulators, you'll need an iOS-enabled device to test this implementation.
- When testing, do not use the Gmail app to open the email that contains the Magic Link. Gmail opens links internally or using Chrome, both of which bypass the detection of the Universal Link by iOS.