We would like to create some kind of wiki and store all articles in a github repository.
As usual in a wiki, the articles should be able to be created or supplemented by anyone*.
Now it would be nice if this would not be possible via the Github page, but from our wiki itself.
For this Github has a fairly extensive API as an interface.
*Authentication via a Github account necessary.
After some research, I found two possibilities:
I would prefer the browser side way, because it does not require a backend.
But the way via PHP seems to be easier for me.
Therefore, first my question, whether the following is possible via Octokit:
After the first comment, i decided not to go the "browser-way". But the way via PHP does not work either, because i just have a webspace with limited access rights (to /.ssh) so i have to lokk for a very different way...
In order to authenticate a GitHub user with their GitHub Account, you need to register a GitHub app or an OAuth app, which you can do in your user account settings or a GitHub organization settings.
For your case, I recommend a GitHub app. It must be installed on a repository in order to grant access, while OAuth Apps are for access tokens with global access.
I don't know PHP, but creating one with JavaScript is fairly straight forward, I just created a new one recently on Glitch: https://glitch.com/edit/#!/twitter-together
When registering the GitHub App, you need to provide a redirect URL which needs to point to your website. The user will be redirected with a ?code=...
query parameter which you will need to exchange for an user access token.
See GitHub's documentation at https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#web-application-flow