Comments (4)
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.
Closing this issue as I consider it answered/solved. Please re-open if you still have problem!
from php-github-api.
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.
I got it working using this, per
php-github-api/lib/Github/AuthMethod.php
Line 19 in 0e2399c
- GITHUB_AUTH_METHOD=http_password
+ GITHUB_AUTH_METHOD=client_id_header
from php-github-api.
Related Issues (20)
- Repo documentation out-of-date? HOT 4
- Secrets Scanning Alerts HOT 1
- Sync a fork branch with the upstream repository
- Suggestion to remove authorizations::create from doc HOT 2
- ResultPager::get() can return string HOT 4
- Add .phpstorm.meta.php to improve code completion HOT 1
- Add support for new github api versioning
- Env API
- Correct Async usage
- projects returning empty. HOT 1
- api('issue')->find() is still documented but was removed
- Http\Client\HttpClient Deprecation HOT 2
- GraphQL queries are not cached
- Allow php-http/cache-plugin version 2 HOT 6
- pull request closing references HOT 1
- reactions
- Get owner's repositorie's activity
- Update `Apps` to accept query parameters as per specification
- Cannnot Remove an Issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-github-api.