Download the PHP package phattarachai/laravel-sso without Composer

On this page you can find all versions of the php package phattarachai/laravel-sso. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-sso

Laravel SSO

Latest Version on Packagist Tests Code Style PHP Version Laravel Version Total Downloads

"Sign in with Google" for a fleet of single-owner Laravel apps, as a drop-in. It replaces each app's password login with three routes, an email allowlist and one owner account. Every app shares one Google OAuth client, and Google's own session makes signing in to the next app a single click.

Installation

sso:install adds the keys below to .env.example, checks that the owner user exists, and prints the redirect URI to register on the Google OAuth client (<APP_URL>/auth/sso/callback).

Then remove the app's own login / logout routes, the password controller and the login page. The package registers these routes itself:

Method URI Name
GET /login login redirect to Google (or the local owner login); ?select=1 forces the account chooser
GET /auth/sso/callback sso.callback allowlist check, log in the owner, redirect()->intended()
POST /logout logout log out → /signed-out
GET /signed-out sso.signed-out "You're signed out" page with a sign-in link

The auth middleware already redirects guests to the route named login, so nothing else needs to change. API, webhook and broadcasting routes are untouched: only the web session login changes.

Google OAuth client

In the Google Cloud Console, create one OAuth client of type Web application and share it across every app:

Google has no API or gcloud command for Web OAuth clients, so adding an app means adding its redirect URI in the Console.

Configuration

php artisan vendor:publish --tag=sso-config publishes config/sso.php. It sets the driver, guard, home URL, the local-login switch and the local host patterns. The rejected and signed-out pages are plain Blade with no build step (--tag=sso-views).

Testing

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-sso with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/auth Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
laravel/socialite Version ^5.28
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phattarachai/laravel-sso contains the following files

Loading the files please wait ...