Get a GitHub client ID and Secret for an OAuth Application

Share this video with your friends

Social Share Links

Send Tweet
Published 3 years ago
Updated a year ago

Get a client ID and Secret from GitHub by registering a new OAuth Application. You can register a new OAuth Application on Github here

Make sure to keep the secret you generated safe. It's the key to your data.

Christian Nwamba: [0:00] Head to github.com∕settings∕applications∕new. Give the application a name. I will call mine Egghead OAuth. Set the home page URL to localhost:1234, which is also the URL endpoint free demo. Copy the URL and use it as the Authorization callback URL.

[0:26] Next, click the Register application button to register your application. You will get a Client ID, and you can also generate a Client secrets. Go ahead and click the generate a new client secret button. Now, head back to the terminal and list the files you have in the startup project.

[0:46] You can see there is a config.example.js file, which is a template for your configuration. Create a copy of the config file and name the copy config.js. Open the config.js file in your editor. Copy the Client ID from the browser and paste it as the value of the CLIENT_ID property. Copy the Client secret form the browser as well and paste as the value of the CLIENT_SECRET property.

[1:15] Open the .gitignore file and make sure you ignore the config.js file so it does not end in source control. This will protect you from leaking your clients' secrets to public.

Md. Anam Hossain
Md. Anam Hossain
~ 3 years ago

Please share Github repo link for this course.

Thiago Ramos
Thiago Ramos
~ 3 years ago

Hey, Anam, how you doing? I think I'm find the repo used in this class. https://github.com/christiannwamba/egghead-oauth-demo

Hope this help you. _o/

Markdown supported.
Become a member to join the discussionEnroll Today