Add Github Login
# Add Github Login
You can add Github login to your applications using Asgardeo and enable users to log in with their Github account.
Follow this guide for instructions.
# Register Asgardeo on Github
You need to register Asgardeo as an OAuth app on Github.
You can follow the Github documentation (opens new window) for detailed instructions.
Log in to Github (opens new window), click your profile icon, and click Settings.
On the left panel of the Settings page, click Developer settings.
Under OAuth apps, click Register a new application.
Give the application a name and the following URLs:
- Homepage URL
- Authorization callback URL
- Homepage URL
Click Register application.
Generate a new client secret and take note of the Client ID and Client secret.
# Register the Github IdP
Now, let's register the Github IdP in Asgardeo.
On the Asgardeo console, go to Develop > Connections.
Click New Connections and select Github.
Enter the following details and click Finish:
Parameter Description Name A unique name for this Github identity provider. Client ID The client ID obtained from Github. Client secret The client secret obtained from Github.
If required, you can disable JIT user provisioning.
After the Github identity provider is created, go to the Settings tab and see the list of scopes to which Github has granted permissions.
- email: Grants read access to a user's primary email address.
- public_profile: Grants read access to a user's default public profile details.
Asgardeo needs these scopes to get user information. Asgardeo checks the attribute configurations of the application and sends the relevant attributes received from Github to the app. You can read the Github Documentation (opens new window) to learn more.
# Enable Github login
Before you begin
You need to have an application registered in Asgardeo. If you don't already have one, register one of the following application types:
On the Asgardeo console, go to Develop > Applications.
Open your application from the list and go to the Sign-in Method tab.
If you haven't already defined a sign-in flow, click Start with Default configuration to get started.
Click Add Authentication on the step, select your Github identity provider, and click Add.
# Try it out
Follow the steps given below.
- Access the application URL.
- Click Login to open the Asgardeo login page.
- On the Asgardeo login page, Sign in with Github.
- Log in to Github with an existing user account.
When a user successfully logs in with Github for the first time, a user account is created in the Asgardeo console with the Github username. This new user account will be managed by Github.