Download the PHP package dutchcodingcompany/filament-socialite without Composer
On this page you can find all versions of the php package dutchcodingcompany/filament-socialite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dutchcodingcompany/filament-socialite
More information about dutchcodingcompany/filament-socialite
Files in dutchcodingcompany/filament-socialite
Package filament-socialite
Short Description Social login for Filament through Laravel Socialite
License MIT
Homepage https://github.com/dutchcodingcompany/filament-socialite
Informations about the package filament-socialite
Social login for Filament through Laravel Socialite
Add OAuth2 login through Laravel Socialite to Filament. OAuth1 (eg. Twitter) is not supported at this time.
Installation
Filament version | Package version |
---|---|
^3.2.44 (if using SPA mode) | ^1.3.1 |
3.x | 1.x.x |
2.x | 0.x.x |
Install the package via composer:
Publish and migrate the migration file:
Other configuration files include:
You need to register the plugin in the Filament panel provider (the default filename is app/Providers/Filament/AdminPanelProvider.php
). The following options are available:
See Socialite Providers for additional Socialite providers.
Icons
You can specify a Blade Icon. You can add Font Awesome brand icons made available through Blade Font Awesome by running:
Registration flow
This package supports account creation for users. However, to support this flow it is important that the password
attribute on your User
model is nullable. For example, by adding the following to your users table migration.
Or you could opt for customizing the user creation, see below.
Domain Allowlist
This package supports the option to limit the users that can login with the OAuth login to users of a certain domain. This can be used to setup SSO for internal use.
Changing how an Authenticatable user is created or retrieved
In your AppServiceProvider.php, add in the boot method:
Change how a Socialite user is created or retrieved
In your plugin options in your Filament panel, add the following method:
This class should at the minimum implement the FilamentSocialiteUser
interface, like so:
Change login redirect
When your panel has multi-tenancy enabled, after logging in, the user will be redirected to their default tenant.
If you want to change this behavior, you can add the setLoginRedirectCallback
method in the boot method of your AppServiceProvider.php
:
Filament Fortify
This component can also be added while using the Fortify plugin plugin.
Filament Breezy
This component can also be added while using the Breezy plugin plugin.
You can publish the login page for Filament Breezy by running:
Which produces a login page at resources/views/vendor/filament-breezy/login.blade.php
.
You can then add the following snippet in your form:
Events
There are a few events dispatched during the authentication process:
InvalidState(InvalidStateException $exception)
: When trying to retrieve the oauth (socialite) user, an invalid state was encounteredLogin(FilamentSocialiteUserContract $socialiteUser)
: When a user successfully logs inRegistered(FilamentSocialiteUserContract $socialiteUser)
: When a user and socialite user is successfully registered and logged in (when enabled in config)RegistrationNotEnabled(string $provider, SocialiteUserContract $oauthUser)
: When a user tries to login with an unknown account and registration is not enabledSocialiteUserConnected(FilamentSocialiteUserContract $socialiteUser)
: When a socialite user is created for an existing userUserNotAllowed(SocialiteUserContract $oauthUser)
: When a user tries to login with an email which domain is not on the allowlist
Scopes
Scopes should be added in your config/services.php
config file, for example:
Optional parameters
You can add optional parameters to the request by adding a with
key to the provider configuration in the config/services.php
config file, for example:
Note: you cannot use the state
parameter, as it is used to determine from which Filament panel the user came from.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-socialite with dependencies
filament/filament Version ^3.0.9
illuminate/contracts Version ^10.0|^11.0
laravel/socialite Version ^5.5
spatie/laravel-package-tools Version ^1.9.2