# How to validate verification code for passwordless

**URL:** <https://community.auth0.com/t/how-to-validate-verification-code-for-passwordless/10026>\
**Category:** Get Help\
**Tags:** twilio, authentication-api, passwordless, authentication, xamarin\
**Created:** [March 13, 2018, 5:05pm UTC](https://community.auth0.com/t/how-to-validate-verification-code-for-passwordless/10026 "2018-03-13T17:05:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![angeltek](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@angeltek](https://community.auth0.com/u/angeltek)\
**Post date:** [March 13, 2018, 5:05pm UTC](https://community.auth0.com/t/how-to-validate-verification-code-for-passwordless/10026/1 "2018-03-13T17:05:18Z")

</div>

I’m trying to validate the verification code that was send through SMS.

I used the following post call in Postman:

```
http://<tenant>/oauth/legacy/grant-type/ro

{
  "client_id": "id",
  "connection": "sms",
  "grant_type": "authorization_code",
  "username": "phone_num",
  "password": "code",
  "scope": "openid profile email"
}

```

But the call is not longer supported for new Auth0 users. So I found another approach using Auth0 AuthenticationAPI but doing so I get

StatusCode = 403

error = invalid\_grant

error\_description = Invalid authorization code

Any ideas on how to validate the verification code?

**using AuthenticationApi implmentation:**

```
var smsReq = new PasswordlessSmsRequest();
                smsReq.ClientId = clientId;
                smsReq.PhoneNumber = someNum;

                var authApi = new AuthenticationApiClient(domain);
                var task = authApi.StartPasswordlessSmsFlowAsync(smsReq);
                var res = task.Result;

                var alert = new AlertDialog.Builder(CrossCurrentActivity.Current.Activity);

                var edit = new EditText(CrossCurrentActivity.Current.Activity) { Hint = "Enter Code" };
                alert.SetView(edit);

                alert.SetTitle("title");

                alert.SetPositiveButton("OK", (senderAlert, args) =>
                {    
                    var tokReq = new AuthorizationCodeTokenRequest();
                    tokReq.ClientId = clientId;
                    tokReq.ClientSecret = clientSecret;
                    tokReq.Code = edit.Text;
                    tokReq.RedirectUri = uri;

                    var auResTask = authApi.GetTokenAsync(tokReq);
                    var autRes = auResTask.Result;
                });

                alert.SetNegativeButton("Cancel", (senderAlert, args) =>
                {
                    
                });
                alert.Show();

```

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [December 18, 2018, 3:27pm UTC](https://community.auth0.com/t/how-to-validate-verification-code-for-passwordless/10026/2 "2018-12-18T15:27:27Z")

</div>

Hey @angeltek

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!

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [December 25, 2018, 7:27am UTC](https://community.auth0.com/t/how-to-validate-verification-code-for-passwordless/10026/4 "2018-12-25T07:27:33Z")

</div>

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