Giter Club home page Giter Club logo

Comments (4)

acrobat avatar acrobat commented on June 21, 2024

I'm not sure what you exact question is here. The service config above looks correct and you should define the mentioned environment variables then authentication is correctly setup.

After that you can inject the Github\Client service into you classes and call the api endpoints

from php-github-api.

acrobat avatar acrobat commented on June 21, 2024

Closing this issue as I consider it answered/solved. Please re-open if you still have problem!

from php-github-api.

tresf avatar tresf commented on June 21, 2024

I have a similar issue as the OP. Configuring the environment is rather trivial, as @acrobat has identified, however troubleshooting issues is difficult because the parameters aren't part of any (obvious?) documentation.

For example, take the following .env file:

GITHUB_USERNAME=username
GITHUB_SECRET=password_or_token
GITHUB_AUTH_METHOD=http_password

If these are omitted, errors are as we'd expect...

- Environment variable not found: "GITHUB_USERNAME".
- Environment variable not found: "GITHUB_SECRET".
- Environment variable not found: "GITHUB_AUTH_METHOD".

And although GITHUB_USERNAME and GITHUB_SECRET are rather obvious, I feel that GITHUB_AUTH_METHOD is not. Searching this project for GITHUB_AUTH_METHOD returns one result (this bug report). Most examples recommend a value of http_password as mentioned, but this results in a new error:

- Github\Exception\RuntimeException: "http_token not yet implemented" at /home/owner/lmms.io/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/Authentication.php

Common sense says that this is incorrect usage (or perhaps an outdated library?) but my Google Fu is returning very little results, leaving doubt. 🍻

from php-github-api.

tresf avatar tresf commented on June 21, 2024

I got it working using this, per

public const ACCESS_TOKEN = 'access_token_header';

- GITHUB_AUTH_METHOD=http_password
+ GITHUB_AUTH_METHOD=client_id_header

from php-github-api.

Related Issues (20)

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.