Auth0 Home Blog Docs

Errors in Lock and passwordless SMS login



I’m currently building a passwordless login system for a Swift app using Lock, and I’m using Twilio to send the SMS OTCs after a user enters their phone number into the app. The code itself for opening the Lock UI is as follows:

func beginLogin()
            .onAuth(){credentials, error in
                print("OKAY, GOT \(credentials)")
            .present(from: self)

Twilio is properly configured, and I can get my OTCs back without any difficulty. However, when I enter the code into the field, the Lock UI displays an error message indicating that it was unable to get back the access token:

![alt text][1]

There aren’t any error messages in the debug console that indicate what went wrong, and my best guess is that I need to register that phone number as a user first, although I’m not too sure how to go about doing that. As a bit of additional information, I’ve enabled the SMS passwordless authentication already, and Twilio is properly configured. Disable sign-ups is also turned off, so I’m wondering if this setting is affecting things; my understanding is that if false, disable sign-ups should allow users to create a new Auth0 account with their phone numbers as a username?


@doug.wk.yuen Try it again and this time check the logs for why it failed -


That did it, I was able to diagnose and fix the issue with information from the logs. Thanks!