Answer the question
In order to leave comments, you need to log in
How to authenticate user in github api?
Hello!
Created an application in Github Apps.
A user from my site can connect via Github.
At the same time, I get the following data:
- token
- refreshToken
- expiresIn
- id
- nickname
- name
- email
- avatar
- and many more in the user parameter
I need to be able to add (for example) a new issue on behalf of the user, this requires user authentication .
I use this library: php-github-api authentification
I tried to authenticate like this:
$client->authenticate($user->github_token, null, Client::AUTH_CLIENT_ID);
Answer the question
In order to leave comments, you need to log in
This is how it happened:
$client->authenticate($user->github_token, Client::AUTH_ACCESS_TOKEN);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question