GitHub

To enable Auth.it to authenticate users with GitHub:

  1. In Auth.it’s Authentication view:
    1. In the GitHub section, click Enable GitHub.
    2. In the configuration pop-up, click the toggle to enable GitHub integration.
    3. Copy the redirect URI that Auth.it displays: GitHub integration settings
  2. In GitHub, create a GitHub OAuth application:
    1. In your GitHub organization, click Settings. Scroll down to Developer settings and click OAuth Apps.
    2. Click New OAuth app.
    3. In Application name, enter a name for your application, such as “[Your application]‘s GitHub login”. This will be displayed to users during the authentication process along with your organization’s name.
    4. Enter your application’s root URL in Homepage URL. This can be a localhost URL for testing purposes or the public URL of your application.
    5. In Authorization callback URL, paste the redirect URI you copied from Auth.it. Here’s an example of what the OAuth app settings may look like: GitHub OAuth application settings
    6. Click Register application.
    7. When the OAuth app is created, copy the value of Client ID.
    8. Under Client secrets, click Generate a new client secret. Copy the value of the secret because it’s only displayed once.
  3. Back in Auth.it’s GitHub configuration pop-up:
    1. Paste the GitHub client ID into GitHub Client ID.
    2. Paste the GitHub client secret into GitHub Client Secret.
    3. Click Save changes.

To test that the GitHub integration is working:

  1. In your application, go to the login page. Notice that it now contains a button to log in with GitHub: Login page with a GitHub login button
  2. Click the GitHub login button.
  3. If your GitHub login session is active, you should see a screen that asks you to authorize the OAuth application you just set up. Click Authorize: Authorize GitHub OAuth app
  4. You are now logged in with GitHub and redirected back to your application.