# 400 error when verifying Passwordless OTP SMS code w/ New Universal Login (Identifier First)

**URL:** <https://community.auth0.com/t/400-error-when-verifying-passwordless-otp-sms-code-w-new-universal-login-identifier-first/102735>\
**Category:** Get Help\
**Tags:** identifier-first, login-experience\
**Created:** [March 16, 2023, 7:28pm UTC](https://community.auth0.com/t/400-error-when-verifying-passwordless-otp-sms-code-w-new-universal-login-identifier-first/102735 "2023-03-16T19:28:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel19](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daniel19/32/45527_2.png) [@daniel19](https://community.auth0.com/u/daniel19)\
**Post date:** [March 16, 2023, 7:28pm UTC](https://community.auth0.com/t/400-error-when-verifying-passwordless-otp-sms-code-w-new-universal-login-identifier-first/102735/1 "2023-03-16T19:28:51Z")

</div>

I am implementing Auth0’s Passwordless with New Universal Login. It works fine with email (connection=“email”).  
However, when I change the connection to “sms”, I receive a 400 from the POST …/u/login/passwordless-sms-challenge?state=… endpoint when attempting to verify my OTP SMS code. I cannot find any documentation available on this passwordless-sms-challenge endpoint to troubleshoot this error.

Verbose Description of the flow:  
I navigate to my app, running on localhost.

Network Traffic:  
GET …/authorize?  
redirect\_uri=http%3A%2F%2Flocalhost%3A4201%2F  
login&  
client\_id={myClientId}&  
audience={myAudience}  
connection=sms&  
scope=openid%20profile%20email&  
response\_type=code&  
response\_mode=query&  
state=…  
nonce=…  
code\_challenge={codeChallengeValue}  
code\_challenge\_method=S256&  
auth0Client={auth0Client}  
302

GET /u/login/identifier?state=  
200

I provide a phone number & press continue.

POST …/u/login/identifier?state=…  
302

GET …/u/login/passwordless-sms-challenge?state=…  
200

My cell phone receives an SMS OTP (using Twilio for SMS). I enter the SMS OTP into Auth0 UI & press Continue.

POST /u/login/passwordless-sms-challenge?state=  
400

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 23, 2023, 2:57pm UTC](https://community.auth0.com/t/400-error-when-verifying-passwordless-otp-sms-code-w-new-universal-login-identifier-first/102735/2 "2023-03-23T14:57:21Z")

</div>

Hi @daniel19,

Welcome to the Auth0 Community!

Are you seeing any info about the error in your dashboard logs? Sometimes you can find a more descriptive error. Also, does the error contain any more info? Like a message stating the problem?

---

<div class="post-metadata">

**Author:** ![daniel19](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daniel19/32/45527_2.png) [@daniel19](https://community.auth0.com/u/daniel19)\
**Post date:** [March 23, 2023, 3:49pm UTC](https://community.auth0.com/t/400-error-when-verifying-passwordless-otp-sms-code-w-new-universal-login-identifier-first/102735/3 "2023-03-23T15:49:50Z")

</div>

Hi @dan.woda ,

Thank you!

Here an example from our Auth0 logs for the OTP Verification Code failing issue:

```auto
{
  "date": "2023-03-22T18:47:15.267Z",
  "type": "fu",
  "description": "Wrong phone number or verification code.",
  "connection": "sms",
  "connection_id": "...",
  "client_id": "...",
  "client_name": "...",
  "ip": "...",
  "user_agent": "Chrome 111.0.0 / Mac OS X 10.15.7",
  "details": {
    "error": {
      "message": "Wrong phone number or verification code."
    }
  },
  "user_id": "",
  "user_name": "...",
  "strategy": "sms",
  "strategy_type": "passwordless",
  "log_id": "...",
  "_id": "...",
  "isMobile": false,
  "id": "..."
}

```

The UI says “Code Invalid” on the screen.

A second issue we have with testing this flow:  
My phone number gets “You’ve reached the maximum number of attempts”. I disabled all of Auth0’s Brute Force Protection features, but I don’t know how to unlock my phone to re-test.  
Others have this issue as well:  
[Email OTP code submission through proxy, “You’ve reached the maximum number of attempts. Please try to login again” - Auth0 Community](https://community.auth0.com/t/email-otp-code-submission-through-proxy-youve-reached-the-maximum-number-of-attempts-please-try-to-login-again/56087)

Thanks,  
Daniel

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 24, 2023, 3:10pm UTC](https://community.auth0.com/t/400-error-when-verifying-passwordless-otp-sms-code-w-new-universal-login-identifier-first/102735/5 "2023-03-24T15:10:34Z")

</div>

Could you please DM me a HAR file of the failed code request? Once we get this resolved we can investigate the second issue.

> **[Generate and Analyze HAR Files](https://auth0.com/docs/troubleshoot/troubleshooting-tools/generate-and-analyze-har-files)**
>
> Learn how to troubleshoot with HAR files and steps to generate a HAR file.

---

<div class="post-metadata">

**Author:** ![daniel19](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daniel19/32/45527_2.png) [@daniel19](https://community.auth0.com/u/daniel19)\
**Post date:** [March 24, 2023, 3:30pm UTC](https://community.auth0.com/t/400-error-when-verifying-passwordless-otp-sms-code-w-new-universal-login-identifier-first/102735/6 "2023-03-24T15:30:19Z")

</div>

For the first issue, I had to manually append my country code in front of my phone # for the SMS to send (for example ‘1{myPhone#}’ would send an SMS OTP to my phone.

However, we discovered that it works if we append a ‘+’ in front of the country code.  
So, ‘+1{myPhoneNumber}’ works (the OTP code successfully validates & we can login to our app).

We can’t roll this out of the box behavior out to production, so we will need to check on Twilio’s side to see what capabilities exist to automatically append this ‘+{countryCode}’ during ingress.

As a point of feedback, this detail would be a useful addition to Auth0’s documentation. I have seen a few forum posts around of people asking for documentation on the /passwordless-sms-challenge endpoint as well.

For the second issue, I disabled all of the brute force protections in the Auth0 panel. The next time my phone identity gets locked out, I will try the management API to see if it works & will report back.  
[Auth0 Management API v2](https://auth0.com/docs/api/management/v2#!/User_Blocks/delete_user_blocks)

Thanks for inquiring.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 24, 2023, 3:51pm UTC](https://community.auth0.com/t/400-error-when-verifying-passwordless-otp-sms-code-w-new-universal-login-identifier-first/102735/7 "2023-03-24T15:51:32Z")

</div>

Thanks for the feedback and follow up.

---

<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 24, 2023, 1:51pm UTC](https://community.auth0.com/t/400-error-when-verifying-passwordless-otp-sms-code-w-new-universal-login-identifier-first/102735/8 "2023-04-24T13:51:51Z")

</div>

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