Skip to content

Latest commit

 

History

History
39 lines (20 loc) · 1.75 KB

File metadata and controls

39 lines (20 loc) · 1.75 KB

Setting up the token to work with GitHub

GitHub uses OAuth2 authentication on it's API to restrict access to private routes and rate limit unauthorized access. Authentication with GitHub is already setup in this project, however, you will need to generate your own developer token and add it to a token.js file at the top level of the project in order to use the provided authentication method. The steps for this setup are below:

  1. Go to GitHub and select settings in the drop down from the upper-right hand side of the navigation bar.

settings

  1. Navigate to Developer settings between Personal settings and Organization settings in the left Navigation.

developer settings

  1. Go to Personal access tokens

personal access tokens

  1. Click Generate new token and if prompted for password use your GitHub account password to authorize token creation.

generate new token

  1. In the token generation screen give the token any description you want and select public_repo under the repo selection and all of the user options.

new token form

  1. Generate the token and copy the newly generated token string.

token

  1. Create a file named token.js at the root of your dev-duel directory.

token file

  1. In the newly created token.js file paste the token string you created into the empty string and add 'token '.

pasted token

In order to verify your token is properly setup, run the application with the command npm run serve and navigate to localhost:3000/api/rate. The "limit" on the "rate" object should be 5000.

rate limit