GitHub SSO Login

Last updated on
23 August 2023

This document will assist you to configure GitHub as an OAuth/OpenID provider, making Drupal an OAuth Client. Following these steps will allow you to configure OAuth/OpenID SSO between GitHub and your Drupal site such that your users will be able to log in to your Drupal site using their GitHub credentials.

We provide the Drupal OAuth Login - OAuth OIDC SSO module which is compatible with Drupal 7, Drupal 8, Drupal 9, and Drupal 10.

Download  Know more

You can check our modules feedback and ratings here.

Prerequisite:

 Step 1: Setting up GitHub as OAuth Provider in Drupal:

  • Navigate to the Configure Application tab and search for GitHub using the search box.

    Drupal OAuth Client Login module - Search For GitHub

  • Now, click on the Copy button to copy the Callback/Redirect URL and keep it handy. After that, click on the Step 2/3 button.

    Drupal OAuth Client Login module - Copy Callback/Redirect URL

Configure OAuth Single Sign-On Application in GitHub:

  • Go to the GitHub admin dashboard and sign up/log in to your account.
  • Navigate to Profile in top right corner and select Settings.

    Drupal OAuth Client Login module - Go to Profile

  • From left navigation bar click on Developer Settings tab. 

    Drupal OAuth Client Login module - Go To Developer Settings

  • Navigate to the OAuth Apps tab and click on Register a new application button.

    Drupal OAuth Client Login module - Select OAuth Apps

  • Register a new OAuth application: Enter the following information

    1. Application name: Enter Application name as per your choice
    2. Homepage URL: Enter your Application Redirect URL
    3. Application description: Enter Application description as per your choice
    4. Authorization callback URL: Enter Callback/Redirect URL (Which we copied in the first step) in the Authorization callback URL text-field.
    5. Enable Device Flow: Click on checkbox to Enable Device Flow.
  • Then, click on Register application button.

    Drupal OAuth Client Login module - Enter Information Aapplication Name

Step 2: Client ID and Client Secret setup in Drupal:

  • Copy the Client ID from the GitHub application and paste it into Drupal OAuth Login's Client ID text field.

    Drupal OAuth Client login module - Copy Client ID

    Drupal OAuth Client Login module - Paste GitHub Client ID

  • Click on Generates a new client secret button. Then, copy Client Secret and paste it into the Drupal OAuth Login's Client Secret text-field. 

    Drupal OAuth Client Login module - Copy Client Secret

    Drupal OAuth Client Login module - Paste GitHub Client Secret

  • Once done, click on the Step 3/3 button.

Step 3: Scope and Endpoints setup in Drupal:

There are two ways using which you can set up the scope and endpoints:

  • Manual Configuration: 
    • Check the Endpoints and Scope. Click on the All Done! button.

      Drupal OAuth Client Login module - Check Scope and Endpoint

GitHub Endpoints and scope:

Scope user repo
Authorize Endpoint https://github.com/login/oauth/authorize
Access Token Endpoint https://github.com/login/oauth/access_token
Get User Info Endpoint https://api.github.com/user

Verify SSO Connection and Mapping:

  • In Summary, You will be able to review the configuration which you have done so far.
  • Once verified, you can click on the Test Configuration button to check the connection between Drupal and GitHub.
  • After a successful connection, select the Email Attribute from the dropdown and click on the Done button.

    Drupal OAuth Client Login module - Test Configuration

  • Congratulations! You have successfully configured GitHub as OAuth Provider and Drupal as OAuth login.
  • Now, open a new browser/private window and go to your Drupal site login page.
  • Click on the Login using GitHub link to initiate the SSO from Drupal.

Support:

Need assistance? Contact our 24*7 support team

If you require any help with installing or configuring this module, please feel free to reach out to us at our 24*7 Support by clicking on the Support Icon from the bottom right corner and send us a query. You can also join us on Drupal Slack in the #miniorange channel.

 Get In Touch With Us Join Our Slack Channel

back to top Back to top