Download the PHP package motomedialab/laravel-google-signin without Composer

On this page you can find all versions of the php package motomedialab/laravel-google-signin. 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-google-signin

Effortless Google Sign-In for Laravel

GitHub Actions

Seamlessly integrate Google OAuth2 Single Sign-On into your Laravel application with this streamlined package. Born out of the need to efficiently implement Google OAuth2 authentication across multiple projects, this package leverages Laravel's Socialite under the hood, adhering to best practices while simplifying the setup process. It bundles the necessary components, controllers, and routes for an effortless implementation.

Installation

Install via Composer:

The package will auto-register. Next, add your Google Client ID and Secret to your .env file (see below for instructions if you haven't set these up yet).

Using the "Sign in with Google" button

This package includes a ready-to-use "Sign in with Google" button. You can include it in your views as a blade component:

For further styling, publish the button view to your project:

That's it! You've successfully added Google SSO to your Laravel project. If you haven't already, you'll need to obtain your Google Client ID and Secret from the Google Developer Console.


Getting your Google Client ID and Secret

  1. Visit the Google Developer Console
  2. Create a new project or select an existing one
  3. Navigate to the "Credentials" tab
  4. Click the "Create Credentials" button and choose "OAuth client ID".
  5. Select "Web application" as the application type
  6. Add the URL to your callback route to the "Authorized redirect URIs" list
    1. you can find this by running php artisan route:list --name=google-signin.store
  7. Click "Create" to generate your Client ID and Secret
  8. Copy the generated ID and secret to your .env file as per Configuration

Further customisation

To tailor the package's behavior further, such as modifying the login process, publish the configuration file and override the default settings:

So what does it actually do?

From a technical standpoint this package adds a google_id column to your users table. When a user attempts to log in with Google, we'll check if a user with the same Google ID already exists - if it does, we'll log them in.

If it doesn't, and there's a user with a matching email address, we'll link the Google ID to that user and log them in.

If both checks fail, we'll return a 403 forbidden response. It's important to note that a user must have a corresponding Google email address already registered on your platform to be able to gain access.

We store the Google ID to prevent future 'email hijacking' attacks, where a user could change their email address to one that's already in use/was in use by another user.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

This package is licensed under the MIT License. See the LICENSE file for more information.

Need help with your next project?

This plugin is maintained and developed by MotoMediaLab, a full-service agency based in the UK. Contact us for assistance with your next project!


All versions of laravel-google-signin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/socialite Version ^v5.0
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 motomedialab/laravel-google-signin contains the following files

Loading the files please wait ....