Skip to content

Latest commit

 

History

History
91 lines (59 loc) · 2.97 KB

create-github-app-guide.md

File metadata and controls

91 lines (59 loc) · 2.97 KB

Steps to Register a new GitHub Application

This guide is based on the official "Creating a GitHub App" instructions: https://developer.github.com/apps/building-github-apps/creating-a-github-app We have added more detailed instructions, better screenshots and annotations. So you can get up-and-running even faster!

This guide is checked periodically by the @dwyl team/community, but Github are known to occasionally change their UI/Workflow, so if anything has changed, or there are extra/fewer steps, please let us know!

1. Open Your GitHub Account Settings

In your web browser, visit: https://github.com/settings/developers

github-auth-01-developer-settings

Click on the "Register a new application" button.
(Note: the button text will be "New OAuth App" if you already have existing apps)

2. Define the details for your application

Ensure that you set the callback URL to /auth/github/callback

github-auth-02-new-app-register

Note: You can edit/change any of these values later.

Click on Register Application

Once your application is successfully created you should see an application settings page similar to this:

github-auth-03-new-app-credentials

3. Copy the Client ID & Secret for the App

Once you have the credentials for your OAuth Client, export them as environment variables so that your Elixir/Phoenix app can access them.

If you are new to environment variables, please see: github.com/dwyl/learn-environment-variables

In our case we add the credentials to an .env (environment variables) file.

Locate the Client ID and Client Secret on the App settings page. Copy the values of the Client ID and Client Secret and save them as environment variables GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET respectively.

GITHUB_CLIENT_ID=d6fca75c63daa014c187
GITHUB_CLIENT_SECRET=8eeb143935d1a505692aaef856db9b4da8245f3c

Copy the two keys and export them in your project see: Step 3 of the README.md

⚠️ Don't worry, these keys aren't valid (they were revoked before we published this guide). They are just here for illustration purposes.



Note on Production Deployment

When you ship your app to your Production environment, you will need to re-visit steps 3 & 4 to update your app settings URL & callback to reflect the URL where you are deploying your app e.g:

In our case https://elixir-auth-github-demo.herokuapp.com and https://elixir-auth-github-demo.herokuapp.com/auth/github/callback