PHPackages                             atomjoy/socialites - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. atomjoy/socialites

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

atomjoy/socialites
==================

Google and Github login buttons with Socialite in Laravel.

v3.1(1y ago)010MITBladePHP ^8.1

Since May 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/atomjoy/socialites)[ Packagist](https://packagist.org/packages/atomjoy/socialites)[ RSS](/packages/atomjoy-socialites/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Google and Github Login with Laravel Socialite
==============================================

[](#google-and-github-login-with-laravel-socialite)

How to add Google and Github login using Socialite in Laravel. Google One Tap with Vue and Laravel Socialite.

Install
-------

[](#install)

Add package and routes.

```
composer require "atomjoy/socialites"
```

Callbacks and local domain
--------------------------

[](#callbacks-and-local-domain)

Change the callback domain, set the local domain to example.org and add ssl.

```
# Google callback
https://example.org/oauth/google/callback

# Github callback
https://example.org/oauth/github/callback

# How to set local domain and SSL for example.org (xampp)
https://github.com/atomjoy/xampp
```

Create Google project
---------------------

[](#create-google-project)

Create Google OAuth consent screen
----------------------------------

[](#create-google-oauth-consent-screen)

Create a consent screen for an app with permissions to:

- auth/userinfo.email
- auth/userinfo.profile
- openid

Create Google oauth keys
------------------------

[](#create-google-oauth-keys)

Create **External** OAuth 2.0 client IDs add callback and retrieve keys

Create a new oauth app on Github and get the keys
-------------------------------------------------

[](#create-a-new-oauth-app-on-github-and-get-the-keys)

Setings
-------

[](#setings)

Update the .env file in the callback links, just change the domain.

```
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URL=https://example.org/oauth/google/callback
GOOGLE_HOME_URL=/

GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_REDIRECT_URL=https://example.org/oauth/github/callback
GITHUB_HOME_URL=/
```

Config service
--------------

[](#config-service)

Append in config/services.php

```
