Skip to content

GitHub OAuth2

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

1. Configure OAuth2 Application in GitHub

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

  1. Log in to your GitHub account using your username and password.

  2. Navigate directly to your GitHub Developer settings.

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

    Image

  1. 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://<your_domain_name>/.
    • 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://<your_domain_name>/oauth/callback/github.
  2. Check the box for Expire user access tokens.

  3. Click on the Register application button.

    Image

  4. Once registered, you will be directed to the application’s page where you will see the Client ID. Copy and save this Client ID for later use.

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

  6. Copy and save the generated secret securely. You will need both the Client ID and Client Secret to configure the provider in AIV later.

    Image

2. Configure Authentication in AIV

  1. Log in to your AIV application.

  2. Click on the Hamburger menu (three horizontal lines) in the top-left corner to open the sidebar.

  3. Expand 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: Github (or your preferred name)

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

      Image

  8. Scroll down to configure the GitHub credentials:

    • Client ID: Paste the Client ID you copied from GitHub.
      • How to find it: Go to your GitHub Developer settings, select your OAuth App, and copy the Client ID.
    • Client secret: Paste the Client Secret you generated in GitHub.
      • How to find it: On the same GitHub page under the Client secrets section, generate and copy the secret.

        Image

  9. Click on the Add provider button in AIV to save and complete the configuration.

  10. 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

3. Test GitHub Authentication

  1. Log out of your AIV application.

  2. Navigate to the AIV login screen. You will now see a Sign in with Github button.

  3. Click on the button to securely sign in using your GitHub account.

    Image

  4. You will be redirected to the GitHub sign-in page. Enter your GitHub Username or email address and Password, then click Sign in.

    Image

  5. GitHub will then send a 6-digit verification code to your registered email address or authentication device. Enter this verification code to proceed.

  6. Next, you will be directed to the GitHub authorization page. Click on the green Authorize button (e.g., Authorize sejalaivhub) to grant testing_githubprovider access to your GitHub account information.

    Image

  7. Upon successful authentication, you will be redirected back to the AIV dashboard.

    Image