Laravel Socialite GitHub Login
You need to read out our previous posts on Laravel Socialite series.
Create GitHub Application
Time to create a GitHub application so visits GitHub New Application Page.
You need to fill the required form and register the GitHub application. After successful submission, you have been redirected to the application dashboard. Here you get the Client Id and Client Secret, which we required to complete our integration.
GitHub App Key and Secret
You need to update app key and app secret in the configuration file located at config/services.php.
return [ 'github' => [ 'client_id' => 'XXX-XXXX', 'client_secret' => 'XXX-XXX-XXXX', 'redirect' => 'http://localhost:8000/callback/github' ],];
Add GitHub Login button in Login View
Add the following code snippet to your login form located at resources/view/auth/login.blade.php.
Finally, Login with GitHub
After updating everything, Lets login with GitHub.
Now, you need to click on the GitHub login button. Here you have to sign in with your GitHub profile and authorize the app to use your profile and email address.
After authorizing the app, you are redirecting back to your Laravel application.
In this article, we are discussing the Laravel Socialite GitHub Login. Im trying to explain to you each of the required details. You are requested to read our previous post on Twitter and LinkedIn for better understanding because Im not adding the common code examples again in this post. We will discuss other platforms such as Facebook, Google, GitLab, and Bitbucket in our future posts. Please feel free to add your comment if any query or submit your feedback 🙂
If you like our content, please consider buying us a coffee.
Thank you for your support!
Buy Me a Coffee