PHPackages                             sahdevpalaniya/laravel-multi-sso - 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. sahdevpalaniya/laravel-multi-sso

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

sahdevpalaniya/laravel-multi-sso
================================

Laravel package for integrating multiple SSO providers

1.2.0(8mo ago)27MITPHPPHP ^8.0

Since Sep 5Pushed 8mo agoCompare

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

READMEChangelogDependencies (3)Versions (4)Used By (0)

SSO-Package for Laravel
=======================

[](#sso-package-for-laravel)

Overview
--------

[](#overview)

This Laravel Composer package provides seamless integration for multiple Single Sign-On (SSO) providers. The supported providers in this version include:

- GitHub
- Google
- JumpCloud
- LinkedIn
- Twitter
- AWS Cognito

The package is designed to be modular, scalable, and easy to configure for any Laravel application.

---

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

[](#installation)

### Step 1: Require the Package

[](#step-1-require-the-package)

```
composer require sahdevpalaniya/laravel-multi-sso
```

### Step 2: Publish the Configuration

[](#step-2-publish-the-configuration)

Publish the configuration file to your Laravel project:

```
php artisan vendor:publish --tag=sso-config
```

This will create a configuration file (`sso.php`) in the `config` directory.

### Step 3: Configure the Environment

[](#step-3-configure-the-environment)

Add the necessary environment variables for your desired SSO providers in the `.env` file. Below are the detailed configurations for each provider.

---

Supported Providers
-------------------

[](#supported-providers)

### GitHub

[](#github)

**Configuration:**

```
SSO_GITHUB_CLIENT_ID=your-github-client-id
SSO_GITHUB_CLIENT_SECRET=your-github-client-secret
SSO_GITHUB_REDIRECT=https://yourdomain.com/sso/github/callback
```

**Routes:**

```
Route::get('/sso/github/redirect', function () {
    return SSO::driver('github')->redirect();
})->name('github.redirect');

Route::get('/sso/github/callback', function (Request $request) {
    $githubData = SSO::driver('github')->callback($request);
    return response()->json($githubData->getData()->data);
})->name('github.callback');
```

---

### Google

[](#google)

**Configuration:**

```
SSO_GOOGLE_CLIENT_ID=your-google-client-id
SSO_GOOGLE_CLIENT_SECRET=your-google-client-secret
SSO_GOOGLE_REDIRECT=https://yourdomain.com/sso/google/callback
```

**Routes:**

```
Route::get('/sso/google/redirect', function () {
    return SSO::driver('google')->redirect();
})->name('google.redirect');

Route::get('/sso/google/callback', function (Request $request) {
    $googleData = SSO::driver('google')->callback($request);
    return response()->json($googleData->getData()->data);
})->name('google.callback');
```

---

### JumpCloud

[](#jumpcloud)

**Configuration:**

```
SSO_JUMPCLOUD_ENTITY_ID=your-jumpcloud-entity-id
SSO_JUMPCLOUD_SSO_URL=your-jumpcloud-sso-url
SSO_JUMPCLOUD_CERTIFICATE=your-jumpcloud-certificate
```

**Routes:**

```
Route::get('/sso/jumpcloud/redirect', function () {
    return SSO::driver('jumpcloud')->redirect();
})->name('jumpcloud.redirect');

Route::get('/sso/jumpcloud/callback', function (Request $request) {
    $jumpcloudData = SSO::driver('jumpcloud')->callback($request);
    return response()->json($jumpcloudData->getData()->data);
})->name('jumpcloud.callback');
```

---

### LinkedIn

[](#linkedin)

**Configuration:**

```
SSO_LINKEDIN_CLIENT_ID=your-linkedin-client-id
SSO_LINKEDIN_CLIENT_SECRET=your-linkedin-client-secret
SSO_LINKEDIN_REDIRECT=https://yourdomain.com/sso/linkedin/callback
```

**Routes:**

```
Route::get('/sso/linkedin/redirect', function () {
    return SSO::driver('linkedin')->redirect();
})->name('linkedin.redirect');

Route::get('/sso/linkedin/callback', function (Request $request) {
    $linkedinData = SSO::driver('linkedin')->callback($request);
    return response()->json($linkedinData->getData()->data);
})->name('linkedin.callback');
```

---

### Twitter

[](#twitter)

**Configuration:**

```
SSO_TWITTER_CLIENT_ID=your-twitter-client-id
SSO_TWITTER_CLIENT_SECRET=your-twitter-client-secret
SSO_TWITTER_REDIRECT=https://yourdomain.com/sso/twitter/callback
```

**Routes:**

```
Route::get('/sso/twitter/redirect', function () {
    return SSO::driver('twitter')->redirect();
})->name('twitter.redirect');

Route::get('/sso/twitter/callback', function (Request $request) {
    $twitterData = SSO::driver('twitter')->callback($request);
    return response()->json($twitterData->getData()->data);
})->name('twitter.callback');
```

---

### AWS Cognito

[](#aws-cognito)

**Configuration:**

```
SSO_AWS_COGNITO_CLIENT_ID=your-aws-cognito-client-id
SSO_AWS_COGNITO_CLIENT_SECRET=your-aws-cognito-client-secret
SSO_AWS_COGNITO_REGION=your-aws-region
SSO_AWS_COGNITO_USER_POOL_ID=your-aws-cognito-user-pool-id
```

**Routes:**

#### Register User

[](#register-user)

To register a new user, you can call the `register` method with an array of user data.

```
Route::post('/sso/aws/register', function (Request $request) {
    $userData = $request->all();
    $response = SSO::driver('aws')->register($userData);
    return response()->json($response);
})->name('aws.register');
```

You can also call the `register` method directly in your code:

```
$userData = [
    'username' => 'testuser',
    'password' => 'Password123!',
    'email' => 'test@example.com',
    // ... other optional attributes
];
$response = SSO::driver('aws')->register($userData);
```

ParameterTypeRequiredDescription`username``string`YesUnique username for the user.`password``string`YesPassword for the user account.`email``string`YesUser's email address.`phone_number``string`NoUser's phone number.`full_name``string`NoFull name of the user.`first_name``string`NoFirst name of the user.`last_name``string`NoLast name of the user.`locale``string`NoUser's preferred locale (e.g., `en-US`).#### Login User

[](#login-user)

To log in a user, you can call the `login` method with an array containing the user's credentials.

```
Route::post('/sso/aws/login', function (Request $request) {
    $credentials = $request->only('username', 'password');
    $response = SSO::driver('aws')->login($credentials);
    return response()->json($response);
})->name('aws.login');
```

You can also call the `login` method directly in your code:

```
$credentials = [
    'username' => 'testuser',
    'password' => 'Password123!',
];
$response = SSO::driver('aws')->login($credentials);
```

ParameterTypeRequiredDescription`username``string`YesUser's username.`password``string`YesUser's password.**✅ Notes**:

1. If the user is already logged in, there is no need to call the login() method again before logout and getUserDetails.
2. Ideally, logout and getUserDetails should directly use the current user's valid access token.

#### Get User Details

[](#get-user-details)

To get user details, you need to provide a valid `accessToken` obtained after a successful login.

```
Route::post('/aws/user-details', function (Request $request) {
    // The access token should be passed in the request body.
    $data = ['access_token' => $request->input('access_token')];
    $awsUserDetails = SSO::driver('aws')->getUserDetails($data);
    return response()->json($awsUserDetails);
})->name('aws.user-details');
```

ParameterTypeRequiredDescription`access_token``string`YesThe access token for the user.#### Logout User

[](#logout-user)

To log out a user, you need to provide a valid `accessToken` obtained after a successful login.

```
Route::post('/sso/aws/logout', function (Request $request) {
    // The access token should be passed in the request body.
    $data = ['access_token' => $request->input('access_token')];
    $response = SSO::driver('aws')->logout($data);
    return response()->json($response);
})->name('aws.logout');
```

ParameterTypeRequiredDescription`access_token``string`YesThe access token for the user.---

Attribute Mapping for AWS Cognito
---------------------------------

[](#attribute-mapping-for-aws-cognito)

The `attributes` array in the `register` API accepts the following keys:

Input KeyRequiredDescription`email`YesUser's email address.`phone_number`NoUser's phone number.`full_name`NoFull name of the user.`first_name`NoFirst name of the user.`last_name`NoLast name of the user.`locale`NoUser's preferred locale.---

Contributing
------------

[](#contributing)

Contributions are welcome! Feel free to fork the repository and submit PRs.

---

Changelog
---------

[](#changelog)

See [CHANGELOG](CHANGELOG) for a detailed history of changes.

---

License
-------

[](#license)

This project is open-source and licensed under the MIT License.

---

Support
-------

[](#support)

For any questions or issues, please create an [issue](https://github.com/sahdevpalaniya/laravel-multi-sso/issues) in this repository or contact .

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance61

Regular maintenance activity

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

245d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/075cdf372d7a417dcdb4b88115312888e49615aa61781d04fe62e16aa9ab232d?d=identicon)[sahdevpalaniya](/maintainers/sahdevpalaniya)

---

Top Contributors

[![testdev98](https://avatars.githubusercontent.com/u/207974526?v=4)](https://github.com/testdev98 "testdev98 (6 commits)")[![sahdevpalaniya](https://avatars.githubusercontent.com/u/110334000?v=4)](https://github.com/sahdevpalaniya "sahdevpalaniya (1 commits)")

---

Tags

laravelgoogleSSOoauthoauth2githubsingle sign ontwitterLaravel Securitylinkedinlaravel-authenticationSocial Loginjumpcloudlaravel-ssomulti-ssolaravel-oauth

### Embed Badge

![Health badge](/badges/sahdevpalaniya-laravel-multi-sso/health.svg)

```
[![Health](https://phpackages.com/badges/sahdevpalaniya-laravel-multi-sso/health.svg)](https://phpackages.com/packages/sahdevpalaniya-laravel-multi-sso)
```

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.5M69](/packages/hwi-oauth-bundle)[and/oauth

Simple and amazing OAuth library with many providers. Just try it out!

4645.2k2](/packages/and-oauth)[fof/oauth

Allow users to log in with GitHub, Facebook, Google, Discord, GitLab, LinkedIn, and more!

50118.7k41](/packages/fof-oauth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
