Skip to content

GitHub Authentication

Follow these steps to configure GitHub authentication in your AIV application:

  1. Log in to AIV using your login credentials.

  2. Click on the Hamburger menu (three horizontal lines) in the top left corner of the screen.

  3. Navigate to the Administration section and click on Authentication.

    Image

  4. The Universal Auth Administration page will open. From the left-hand directory menu, select Providers.

  5. Under the Add provider section, locate the Provider type dropdown. By default, it will be set to Database (already configured).

  6. Click the dropdown and select GitHub OAuth2.

  7. Fill in the following details for the new provider:

    • Provider name: testing_github_provider (or your preferred name)

    • Priority: 100

    • Make sure to check the box for Enabled (show OAuth button on login).

      Image

  8. Once the details are filled, you will need to configure the OAuth2 application in GitHub.

Configuring OAuth2 Application in GitHub

To complete the setup, you must create an OAuth2 application within your GitHub account:

  1. Navigate to GitHub Developer settings(GitHub → Settings → Developer settings → OAuth Apps).

  2. If prompted, Log in to GitHub using your username and password.

  3. Click on New OAuth App to register a new application.

    Image

  4. Fill in the required application details:

    • Application name: Enter a name, such as testing_githubprovider.
    • Homepage URL: Enter your AIV homepage URL, for example, https://aiv.test.oneaiv.com:8087/.
    • Application description: (Optional) Add a description for your application.
    • Authorization callback URL (or Redirect URI): Enter the callback URL for your AIV instance, such as https://aiv.test.oneaiv.com:8087/oauth/callback/github.
  5. Check the box for Expire user access tokens.

  6. Click on the Register application button.

    Image

  7. Once registered, you will be directed to the application’s page where you will see the Client ID. Copy this Client ID and paste it into the Client ID field in the AIV OAuth2 application configuration page.

  8. Under the Client secrets section on the GitHub page, click on Generate a new client secret.

  9. Copy the generated secret and paste it into the Client secret field in the AIV application.

  10. On the same GitHub page, scroll down to find the Redirect URI. Copy this URL and paste it into the corresponding Redirect URL field in your AIV application.

    Image

  11. Finally, click on the Add provider button in AIV to save and complete the configuration.

  12. A success popup message will appear, and you will now see your newly created GitHub authentication provider listed as Active in the Provider configuration list.

    Image

Logging in with GitHub

Once the configuration is complete, you can test the GitHub login flow:

  1. Go to your AIV login screen. You will now see a Sign in with testing_github_provider button (or the name you specified). Click on it.

    Image

  2. You will be redirected to the GitHub authorization page. Click on Authorize to grant AIV access to your GitHub account information.

    Image

Summary

By completing these steps, you have successfully integrated GitHub OAuth2 authentication with your AIV application. Users will now be able to securely and conveniently log in to AIV using their GitHub accounts.