How to validate verification code for passwordless

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();

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!

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