Giter Site home page Giter Site logo

github-api3-php's Issues

Basic login seems to not be working

When I try to login the script throw no errors,

but I am obviously not logged in as

var_dump($user->emails()->all());

report unauthorized

using
$user->setCredentials(new Authentication\Basic('username', 'password'));
$user->login();

Error in "User-Agent header "

Hi there,

I'm trying to use the api, but with this basic code :

require_once dirname(__FILE__) . '/github-api3-php/lib/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';

$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
// Register the location of the GitHub namespace
$loader->registerNamespaces(array(
    'Buzz'              => __DIR__.'/github-api3-php/lib/vendor/Buzz/lib',
    'GitHub'            => __DIR__.'/github-api3-php/lib'
));
$loader->register();
use GitHub\API\Authentication;
use GitHub\API\User\User;
use GitHub\API\AuthenticationException;
use GitHub\API\User\User;
 
    // Setup the user, and authenticate (using basic HTTP auth)
    $user = new User();
    $user->setCredentials(new Authentication\Basic('quoidautre', 'MY_PASSWORD'));
    $user->login();

    // Get the user details
    $response = $user->get();
 var_dump($response);

I've this error :

object(Buzz\Message\Response)[8]
  protected 'headers' => 
    array (size=4)
      0 => string 'HTTP/1.0 403 Forbidden' (length=22)
      1 => string 'Cache-Control: no-cache' (length=23)
      2 => string 'Connection: close' (length=17)
      3 => string 'Content-Type: text/html' (length=23)
  protected 'content' => string 'Request forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required). Check https://developer.github.com for other possible causes.' (length=213)

Any idea ?, can anybody helps me ?

Thanks.
Fabrice

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.