To enable your users to login with GitHub, you must enable GitHub login in the builder and then create an application with GitHub to serve as the OAuth provider.
Read below to learn how.
Go to Home and click on the Login Box builder.
In the left panel, toggle the switch to on for GitHub.
When making changes to the settings in the builder, be sure to commit your changes and then publish for them to take effect and to configure them in your environments.
Follow the steps to below to configure GitHub login.
When moving a project from one environment to another, Frontegg moves the social login environment configurations for you. For instance, if moving from development to production, Frontegg moves the development social login configurations to production.
On your GitHub account, navigate to your
Organization Account Settings.
Register an application and fill the application name and details. Under the callback URL, enter your frontend application URL followed by the string
/account/social/success as shown below.
Organization vs Personal Account
You do not need to have a GitHub Organization to allow GitHub social login. If using your personal account, in GitHub visit Settings ➜ Developer Settings ➜ OAuth Apps ➜ New OAuth App and follow similar steps.
Now that your application is created, you should be redirected to the application configuration screen.
Client secrets, click on
Generate a new client secret and save the generated secret.
Go to Environments ➜ [NAME OF ENVIRONMENT] ➜ Authentication ➜ Social Logins.
Click on the GitHub manage button.
Enter your GitHub Client ID, Client Secret, and Redirect URL. Then save and publish.
In your login screen, you should see a GitHub button that redirects to the GitHub OAuth Consent screen for login. Test it to make sure it works.
Set Who Can Login With GitHub
By default, only invited users can login with GitHub. If you want to allow new users to signup with GitHub, go to the Login Box builder and enable Allow Signups in the left panel.
Scopes let you specify exactly what type of information your application can fetch from your users after they grant it access— and the generated access token includes these approved scopes. Frontegg currently fetches a user profile and user email as default scopes when users authenticate via their Github account. You can add additional, custom scopes to your social login via your Frontegg portal. To do so, go to [Environment name] > Authentication > Social login > Custom > Scopes. You can check Github's supported scopes here.
Updated 15 days ago