GithubHelp home page GithubHelp logo

authy-php's People

Contributors

castis avatar chrisdeeming avatar cmodijk avatar dcu avatar enygma avatar giampy5 avatar goodeath avatar luisuribe avatar merlin-bud avatar robinske avatar rotorsolutions avatar senekis avatar serargz avatar tufla avatar vargasx avatar zqueal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

authy-php's Issues

Unable to Change Locale. (SMS Language)

  1. On Twilio, Default locale is Identified on basis of Country code, But on Authy its documented as "en" (English)

  2. There is no way to overide default locale. For Ex, I want to set language as "English" default was "Hindi", as per Twilio, i need to pass locale = 'en' in request params , but in
    Authy->phoneVerificationStart there is no way to pass that param, i need to manually edit this function to add this param, to got it working.

Please add Twilio supported Params,
https://www.twilio.com/docs/verify/api/verification#request-a-verification-code

Conflict in dependancies with spring boot 2.0.5

For anyone using spring boot 2.0.5, I was getting the following error during runtime
java.lang.NoSuchMethodError: org.json.JSONObject

to resolve I needed to exclude the following com.vaadin.external.google from spring-boot-starter-test:

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		   	<exclusions>
		   		<exclusion> 
		          	<groupId>com.vaadin.external.google</groupId>
		          	<artifactId>android-json</artifactId>
		       </exclusion>
     			</exclusions> 
		</dependency>

As that package had its own org.json dependency. Hope this saves someone some time

Guzzle 6 Support?

Our main app uses Guzzle 6, which afaik is the "current" version. Are there any plans to update this package to use Guzzle 6?

One touch verification endpoints

Hi Guys,

I started using Authy for our project and I think that you made nice stuff but there is one issue with your library. I want to use one touch verification feature and had to extend your API class to handle this. Is there possible to merge pull request regarding one touch verification in the next release? Will be nice ;)

Best regards :)

Support errors and status codes as stated on Twilio API

Currently due to the implementation of the AuthyResponse class (protected internal variables), there is no way to access the response body or status code directly without rewriting (extending classes) of the library yourself.

This creates an issue with error handling. As stated here https://www.twilio.com/docs/verify/return-and-error-codes there are multiple status codes as well as custom error codes (which are part of the response's body).

It would be beneficial to add a body() and a statusCode() function (or similar) to the said class.

public function body()
{
        return $this->body;
}

public function statusCode()
{
        return $this->raw_response->getStatusCode();
}

It appears that there is a bodyvar method. However, the status code is not available and bodyvar is restricting the usage of custom exception handling based on the body contents, you need to retrieve every variable independently.

Update the docs

Could you please do the world a favor and update the readme to correspond to the code, so we don't waste our time implmenting a workflow that's no longer valid...

VerifyToken

So using the method verifyToken is giving me some problems. When I analyze the response I get this:

object(Authy\AuthyResponse)#582 (3) {
  ["raw_response":protected]=>
  array(6) {
    ["meta"]=>
    NULL
    ["body"]=>
    NULL
    ["error"]=>
    bool(true)
    ["error_msg"]=>
    string(359) "Stream open failed for '/protected/json/verify/4095167/6317476?api_key=my_key&force=true'; req_time: 4.792213439941406E-5; opts: {"http":{"timeout":240,"method":"GET","content":null,"user_agent":"authy-php v1.3.0","header":["Content-Type: application\/x-www-form-urlencoded","Connection: close"],"ignore_errors":1,"max_redirects":0}}"
    ["status"]=>
    int(0)
    ["headers"]=>
    array(0) {
    }
  }
  ["body":protected]=>
  NULL
  ["errors":protected]=>
  object(stdClass)#589 (0) {
  }
}

But when I do the GET call manually with postman:
captura de pantalla de 2015-04-27 09 02 38
it works perfectly

{
"message": "Token is valid.",
"token": "is valid",
"success": "true"
}

GitHub Changes doesn't reflect on packagist

Hi Authors
i recently installed this library via composer, i am unable to see the updated version that is on git hub for e.g whole phone verification methods are missing.

your urgent action required..

QR Code method missing from 4.x release

Somehow the qrCode method was merged directly into a 3.x release branch, and is missing from the 4.x release due to it not being available in master.

The PR in question: #61

Class 'Resty' not found

Hey,

I just added authy to my composer.json in my new Laravel framework based project.

I did composer update (as I'd already installed Laravel completely before and just needed to add the Authy PHP SDK) and it downloaded Authy into my project ready to start using.

Trouble is, when I start using the API I get an error:

Class 'Resty' not found

Which points to the Authy code.

How can I fix this?

Help with Error_code when I create an user

Hi,
I need help with my code, I can't create an user; always I have the error_code 60030 and I dont find the error on the code.
If someone finds it, I would appreciate it too much. It's for a college project for my grades.
Thanks.

`<?php
$tituloPagina = "Activacion 2FA";
session_start();

include_once "registro.php";
include_once "conexion.php";
require "vendor/autoload.php"; //accedemos a las librerias del composer.json


$apiKey = "WeuGMlbzYPfa9uz0ZZ50BZd16H9nDsiv";
$apiUrl= "https://api.authy.com/protected/json/users/new?api_key=WeuGMlbzYPfa9uz0ZZ50BZd16H9nDsiv";

?>

Activacion del segundo factor de autenticación

Email: *
País: *
Celular: *
<script src="jsform.authy.js"></script>

Recuerde descargar la App de Authy

registerUser($email, $celular, $codPais); if ($user->ok()) { echo '<script language="javascript">alert("'.$user->id().'");</script>'; echo '<script language="javascript">alert("El Id authy para el usuario "'.$email.'" es: '.$user->id().'");</script>'; $id_authy=$user->id(); $insertar=mysqli_query($conexion,"INSERT INTO usuarios(celular,pais,id_authy) VALUES ('$codPais','$celular','$id_authy') WHERE email='".$email."'") or die (mysqli_error($conexion)); echo '<script language="javascript">alert("Activacion Exitosa");</script>'; echo "<script language='javascript'>window.location='productos.php'</script>"; }else{ foreach ($user->errors() as $field => $error) { echo 'Error en '.$field.': '.$error; } } } include ("inc/footer.php"); ?>`

Please make new releases

The last official release was version 3.0 in January, but since then there have been a number of potentially significant updates. Most of them have bumped the version, which in retrospect may not have been necessary.

I currently have my project pulling directly from dev-master but that's a fairly poor practice and makes me slightly nervous as it means my project will automatically receive the newer code, even if there are BC issues.

I'm not sure whether you want to bump the version back down to 3.0.1 and do a release or even bump it forward to 3.1 (#55 could represent breaking changes for extending code as assumptions about the base_uri may now be invalidated in order to have made OneTouch work).

Either way, some official release would be ideal 👍

Guzzle http

Hi, can i use the v6 of Guzzle http with authy php ?

Thanks for reply

Guzzle Version

Hello there,
Can you please upgrade the guzzle to latest version ? Mostly other packages require guzzle version to 6.0.0 or above but authy require 5.3.1 or lower.

Thank you.

Guzzle 6.0 incompatibility

It would be nice to release a version of Authy-PHP using Guzzle 6.0 instead of Guzzle 5.0. Actually I can't use this library in the project where I'm working because there is a dependencies conflict.

Composer tries to install a very old version of Authy-PHP because it uses Resty instead of Guzzle, but it lacks a lot of features, so that is not a solution for me.

If "semver" is used for Authy-PHP versioning, then it should be easy to port the current version to Guzzle 6.0 without having to worry about breaking backwards compatibility.

Cannot auth using example

Trying to auth with PHP library as per example without success

Auth attempts return stream error with url http://verify/{tokencode}/token{key}?force=true

it looks like the api url isnt loading correctly

In the code it is stated as

 $resp = $this->rest->get("verify/{$token}/{$authy_id}", array(

            'query' => $params
        ));

It doesnt appear to be loading the $api_url which is listed in AuthyApi.php as https://api.authy.com

If I try and manually run this I get notification that this is the wrong url being api.authy.com/verify is incorrect.

I have checked the python library and it uses api.authy.com/protected/json/verify can you advise what the correct url is?

If I attempt to use this url I get "error_code":"60001","message":"Invalid API key","errors":{"message":"Invalid API key"},"success":false

error 500 in WordPress

Hi!

I am trying to require Authy in my WordPress instalation, in my functions.php file but I am not able to create a new instance of Authy. The server responds with a error 500. Somebody knows if I have to do something else? Maybe I need to call to another dependency?

thanks

Upgrade to Guzzle 7.x

Laravel 8 just got released and ships with Guzzle version 7.x out of the box. For now, the package can't be used in a new Laravel 8 project as the current stable release (3.0.5) requires Guzzle v6.0.x and the RC (3.1.0) requires v6.5.x.
Installing it produces the error below:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for guzzlehttp/guzzle (locked at 7.0.1, required as ^7.0.1) -> satisfiable by guzzlehttp/guzzle[7.0.1].
    - authy/php 3.0.4 requires guzzlehttp/guzzle ~6.0 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
    - authy/php 3.0.5 requires guzzlehttp/guzzle ~6.0 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
    - authy/php 3.1.0-rc1 requires guzzlehttp/guzzle ~6.0 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
    - authy/php v3.0 requires guzzlehttp/guzzle ~6.0 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
    - Conclusion: don't install guzzlehttp/guzzle 6.5.x-dev
    - Installation request for authy/php ^3.0 -> satisfiable by authy/php[3.0.4, 3.0.5, 3.1.0-rc1, v3.0]

how to obtain authy-id after creating a user

Hi,

After I create a user using the API, e.g.:
$user = $authy_api->registerUser('email', 'xxx-xxx-xxxx', '1');

How could I get the 'authy-id' from the return $user object?

The command print_r($user) shows that it is a 'protected' field so I guess there is a function like 'getID' or something to retrieve the 'authy-id'?

Authy\AuthyUser Object
(
[raw_response:protected] => GuzzleHttp\Psr7\Response Object
(
+-- 78 lines-------------------------------------------------------
)

[body:protected] => stdClass Object
    (
        [id] => 15xxxxxx0
    )

[errors:protected] => stdClass Object
    (
    )

)

Please advise. Thanks. Best regards,

Is this dead?

Hi,
is this library dead?
I'm actually using it and it would be bad if it won't be actively supported...

Project states PHP 5.3 compatibility but is rife with PHP 5.4 features

the version 2.5 README and composer.json both state 5.3.0 or greater.

however there are short array declarations [] in authy and the version of guzzle it depends on (and still further dependencies PSR, promises), there are callable type hints, static anonymous functions, anonymous functions with closure over $this, use of curl_reset in there, and probably other things i have not found yet as i revise the code to work with PHP 5.3.10.

there does not appear to be documentation anywhere noting which specific version of authy to use for PHP prior to 5.4 so now i am stuck trial-and-erroring my way backward through releases.

PHP 5.4 required? (Guzzle dependency)

Loading composer repositories with package information

Installing dependencies (including require-dev)

Your requirements could not be resolved to an installable set of packages.

Problem 1

  • guzzlehttp/guzzle 5.3.0 requires php >=5.4.0 -> your PHP version (5.3.27) does not satisfy that requirement.

Is there any workaround?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.