Vanilla Javascript GitHub Authentication
Budget: $30 – $250 USD
Create a minimal index.html web page that contains the following:
```
<input id=“login-button” type=“button” value=“Log In”>
<div id=“access-token”></div>
<script>
var token_element = document.getElementById(‘access-token’);
document
.getElementById(‘login-button’)
.addEventListener(‘click’, function ()
{
// do stuff to get users github access token
// and store it locally.
token_element.innerHTML = "Your access token: " + access_token;
});
</script>
```
When you click the button, you are redirected to github to login. You enter your credentials and are redirected back to the web page. The web page displays the access code.
I just want the simplest vanilla javascript way to do this. No web frameworks. Preferably no libraries other one from github.
This does require the person who owns the app to register the app with github.
Here are some resources:
[Identifying and authorizing users for GitHub Apps - GitHub Docs](https://docs.github.com/en/developers/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps)
[gitHub Authorization REST API - YouTube](https://www.youtube.com/watch?v=8EjSLjHhsIQ)
```
<input id=“login-button” type=“button” value=“Log In”>
<div id=“access-token”></div>
<script>
var token_element = document.getElementById(‘access-token’);
document
.getElementById(‘login-button’)
.addEventListener(‘click’, function ()
{
// do stuff to get users github access token
// and store it locally.
token_element.innerHTML = "Your access token: " + access_token;
});
</script>
```
When you click the button, you are redirected to github to login. You enter your credentials and are redirected back to the web page. The web page displays the access code.
I just want the simplest vanilla javascript way to do this. No web frameworks. Preferably no libraries other one from github.
This does require the person who owns the app to register the app with github.
Here are some resources:
[Identifying and authorizing users for GitHub Apps - GitHub Docs](https://docs.github.com/en/developers/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps)
[gitHub Authorization REST API - YouTube](https://www.youtube.com/watch?v=8EjSLjHhsIQ)