twilio / authy-php

A PHP client for Authy
245 stars 87 forks source link

verifyToken received by requestSms fails after update to v3.0 #57

Closed orbex closed 5 years ago

orbex commented 6 years ago

Trying to upgrade from v2.2 to v3.0 Able to receive a token (int in v3.0, was string in v2.2) via SMS, but when verifying given token, API returns "token invalid"... Is there a changelog somewhere I can read through to try to find (breaking) changes ? Have already gone through the docs at https://www.twilio.com/docs/authy ...

orbex commented 6 years ago

Bug: authy_v3_token_sms While testing the new code, I received a token from the API which started with a zero (see screenshot). This token cannot pass the new __validateVerify() function as it needs to be captured as a string to retain the first zero.

Issue reopened

orbex commented 5 years ago

Has this ever been resolved ?

DevOwais commented 5 years ago

facing the same issue, what's the status? is it fixed or not ?

luisuribe commented 5 years ago

Hi, sorry for the late reply. This is in our timeline for next release that will happen next week.

luisuribe commented 5 years ago

So, I was taking a look at this and couldn't reproduce the issue. Using https://github.com/luisuribe/authy-sample-app I did some tests with a token starting with zero and it works.

Could you please share some code so we can check and maybe find a solution?

Also, please have in mind that from 2.2 to 3.0 there's a lot of changes (sadly without a changelog, but that's going to change) that could cause your app to stop working.

DevOwais commented 5 years ago

This issue is not reproducible, moreover kindly add method to generate Qrcode as well for google authenticator, I have created one but I want you to implement it in our branch so it will be good for others too.

public function getQrCode($format,$authy_id, $opts = []) { $authy_id = urlencode($authy_id); $format = urlencode($format); $resp = $this->rest->post("/protected/{$format}/users/{$authy_id}/secret", array_merge( $this->default_options, ['query' => $opts] ));

return new AuthyResponse($resp);

}

On Wed, May 1, 2019 at 12:19 AM Luis Uribe notifications@github.com wrote:

So, I was taking a look at this and couldn't reproduce the issue. Using https://github.com/luisuribe/authy-sample-app I did some tests with a token starting with zero and it works.

Could you please share some code so we can check and maybe find a solution?

Also, please have in mind that from 2.2 to 3.0 there's a lot of changes (sadly without a changelog, but that's going to change) that could cause your app to stop working.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/twilio/authy-php/issues/57#issuecomment-488080795, or mute the thread https://github.com/notifications/unsubscribe-auth/ALHOYRAGMSGMFKW2JXJVD4TPTCLUJANCNFSM4FRD3K6Q .

orbex commented 5 years ago

Hi @luisuribe, thanks for checking things out and supplying your sample-app which pointed me in the right direction :) Solved the issue by removing any and all casting of $token that was done by our own code.

Resolved