PHPackages                             kundu/orgsignin - 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. kundu/orgsignin

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

kundu/orgsignin
===============

Google Sign-In for Laravel with domain restrictions

21.1kPHP

Since Nov 25Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

### Laravel Organization Google Sign-In Package Guide

[](#laravel-organization-google-sign-in-package-guide)

#### Overview

[](#overview)

This package provides a straightforward way to integrate Google Sign-In with domain restrictions into your Laravel application. It allows only users from a specific domain to authenticate using their Google accounts.

#### Prerequisites

[](#prerequisites)

Ensure your environment meets the following requirements:

- **PHP Version**: ^7.2 or ^8.2
- **Laravel Version**: ^8.0 or ^11.0
- **Google API Client Credentials**: Set up through Google Cloud Console

---

### Installation

[](#installation)

#### 1. Install the Package

[](#1-install-the-package)

To install the package, run the following command in your terminal:

```
composer require kundu/orgsignin
```

#### 2. Publish Configuration and Views

[](#2-publish-configuration-and-views)

After installation, publish the configuration file:

```
php artisan vendor:publish --tag="orgsignin-config"
```

Optionally, you can also publish the views:

```
php artisan vendor:publish --tag="orgsignin-views"
```

---

### Configuration

[](#configuration)

#### 1. Environment Variables

[](#1-environment-variables)

Add the following variables to your `.env` file to configure Google Sign-In:

```
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
ORG_SIGNIN_ALLOWED_DOMAIN=your-allowed-domain.com,another-allowed-domain.com
ORG_SIGNIN_USER_TABLE=users
ORG_SIGNIN_EMAIL_COLUMN=email
ORG_SIGNIN_CHECK_VERIFIED=true
ORG_SIGNIN_REDIRECT_ROUTE=/home
SIGNIN_BUTTON_TEXT="Sign in with Google"
```

#### 2. Google OAuth Credentials

[](#2-google-oauth-credentials)

Configure your Google OAuth credentials in the Google Cloud Console, making sure to set the correct redirect URI for your Laravel app.

---

### Integration

[](#integration)

#### 1. Include the Sign-In Button

[](#1-include-the-sign-in-button)

To display the Google Sign-In button on your login view, add this line:

```
@include('orgsignin::components.signin-button')
```

#### 2. Route Protection

[](#2-route-protection)

Apply the `ValidateDomain` middleware to protect routes and allow access only to users with the specified email domain. For example:

```
Route::middleware(['auth', ValidateDomain::class])->group(function () {
    Route::get('/dashboard', function () {
        return view('dashboard');
    });
    // Additional protected routes...
});
```

---

### Authentication Flow

[](#authentication-flow)

This package handles the authentication flow as follows:

1. **Domain Validation**: Ensures the user’s email belongs to the allowed domain.
2. **User Verification**: Checks if the user exists in the database.
3. **Optional Email Verification**: Verifies the user’s email if required.

Upon successful authentication, users are redirected to the specified route (`ORG_SIGNIN_REDIRECT_ROUTE`); otherwise, an error message is displayed.

---

### Customization

[](#customization)

You can customize the views and configuration to fit your application. The text on the sign-in button can be changed using the `SIGNIN_BUTTON_TEXT` environment variable.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9363a69b0f72919982e9afd0a1599fa808cfed3779d1472c4a2bb7c037918c64?d=identicon)[kundu](/maintainers/kundu)

---

Top Contributors

[![kundu](https://avatars.githubusercontent.com/u/17053340?v=4)](https://github.com/kundu "kundu (8 commits)")

### Embed Badge

![Health badge](/badges/kundu-orgsignin/health.svg)

```
[![Health](https://phpackages.com/badges/kundu-orgsignin/health.svg)](https://phpackages.com/packages/kundu-orgsignin)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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