PHPackages                             coderello/laravel-passport-social-grant - 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. coderello/laravel-passport-social-grant

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

coderello/laravel-passport-social-grant
=======================================

Social Grant for Laravel Passport

4.0.0(12mo ago)179607.4k↑14.2%21[1 PRs](https://github.com/coderello/laravel-passport-social-grant/pulls)3MITPHPPHP ^8.2CI passing

Since Mar 19Pushed 10mo ago4 watchersCompare

[ Source](https://github.com/coderello/laravel-passport-social-grant)[ Packagist](https://packagist.org/packages/coderello/laravel-passport-social-grant)[ RSS](/packages/coderello-laravel-passport-social-grant/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (14)Used By (3)

Laravel Passport Social Grant
=============================

[](#laravel-passport-social-grant)

[![Packagist](https://camo.githubusercontent.com/881a27634bd1e33aafc3f98873a1520aad03e65e830403964f05b1e5e637e887/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f636f646572656c6c6f2f6c61726176656c2d70617373706f72742d736f6369616c2d6772616e74)](https://packagist.org/packages/coderello/laravel-passport-social-grant)[![GitHub tag](https://camo.githubusercontent.com/b5dc0d2329b3e8e28c65fef582cea37fc5cbaeb232949f7e5db3083f99abf670/68747470733a2f2f62616467656e2e6e65742f6769746875622f7461672f636f646572656c6c6f2f6c61726176656c2d70617373706f72742d736f6369616c2d6772616e74)](https://github.com/coderello/laravel-passport-social-grant/tags)[![License](https://camo.githubusercontent.com/d347e329674fe1104d6ca52929fd9a1b9924b9ae6f95e0208360632f9a4806a0/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6c6963656e73652f636f646572656c6c6f2f6c61726176656c2d70617373706f72742d736f6369616c2d6772616e74)](LICENSE.md)[![Downloads](https://camo.githubusercontent.com/55628d0518f03aed8d8a2efc9a6a713b4f851cc1e3e72f9869697b637e77073f/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f636f646572656c6c6f2f6c61726176656c2d70617373706f72742d736f6369616c2d6772616e74)](https://packagist.org/packages/coderello/laravel-passport-social-grant/stats)[![tests](https://github.com/coderello/laravel-passport-social-grant/workflows/tests/badge.svg)](https://github.com/coderello/laravel-passport-social-grant/actions)

This package adds a social grant for your OAuth2 server. It can be useful if have an API and want to provide the ability for your users to login/register through social networks.

As a result you will be able to exchange `access_token`, issued by the OAuth2 server of any social provider, to `access_token` and `refresh_token` issued by your own OAuth2 server. You will receive this `access_token` and return the user instance that corresponds to it on your own.

Installation
------------

[](#installation)

You can install this package via composer using this command:

```
composer require coderello/laravel-passport-social-grant
```

The package will automatically register itself.

Configuring
-----------

[](#configuring)

As the first step, you need to implement `SocialUserResolverInterface`:

Here is an example using [Socialite](https://laravel.com/docs/12.x/socialite) -

```
