All Projects → GeneaLabs → laravel-socialiter

GeneaLabs / laravel-socialiter

Licence: MIT license
Automatically manage user persistence and resolution for any Laravel Socialite provider.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-socialiter

Weibo
[READ ONLY] Subtree split of the SocialiteProviders/Weibo Provider (see SocialiteProviders/Providers)
Stars: ✭ 37 (-13.95%)
Mutual labels:  oauth, socialite
Twitter
[READ ONLY] Subtree split of the SocialiteProviders/Twitter Provider (see SocialiteProviders/Providers)
Stars: ✭ 21 (-51.16%)
Mutual labels:  oauth, socialite
VKontakte
[READ ONLY] Subtree split of the SocialiteProviders/VKontakte Provider (see SocialiteProviders/Providers)
Stars: ✭ 82 (+90.7%)
Mutual labels:  oauth, socialite
Instagram
[READ ONLY] Subtree split of the SocialiteProviders/Instagram Provider (see SocialiteProviders/Providers)
Stars: ✭ 34 (-20.93%)
Mutual labels:  oauth, socialite
Slack
[READ ONLY] Subtree split of the SocialiteProviders/Slack Provider (see SocialiteProviders/Providers)
Stars: ✭ 11 (-74.42%)
Mutual labels:  oauth, socialite
Twitch
[READ ONLY] Subtree split of the SocialiteProviders/Twitch Provider (see SocialiteProviders/Providers)
Stars: ✭ 20 (-53.49%)
Mutual labels:  oauth, socialite
Spotify
[READ ONLY] Subtree split of the SocialiteProviders/Spotify Provider (see SocialiteProviders/Providers)
Stars: ✭ 13 (-69.77%)
Mutual labels:  oauth, socialite
cb4
Joint Online Judge
Stars: ✭ 20 (-53.49%)
Mutual labels:  oauth
oidc
Easy to use OpenID Connect client and server library written for Go and certified by the OpenID Foundation
Stars: ✭ 475 (+1004.65%)
Mutual labels:  oauth
Device-Flow-Proxy-Server
Add the OAuth 2.0 Device Flow to any OAuth server
Stars: ✭ 64 (+48.84%)
Mutual labels:  oauth
undertow-pac4j
Security library for Undertow: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 35 (-18.6%)
Mutual labels:  oauth
google-oauth2-web-client
Login with Google using OAuth2 for client-side web app
Stars: ✭ 32 (-25.58%)
Mutual labels:  oauth
materialize-social
Social Login Buttons for MaterializeCSS
Stars: ✭ 50 (+16.28%)
Mutual labels:  oauth
ApiJwtWithTwoSts
Web API authorization, multi-IDP solutions in ASP.NET Core
Stars: ✭ 43 (+0%)
Mutual labels:  oauth
jfinal-justauth-demo
Jfinal集成JustAuth的demo
Stars: ✭ 26 (-39.53%)
Mutual labels:  oauth
ada-security
Ada Security - OAuth 2.0 client and server framework to secure web applications
Stars: ✭ 18 (-58.14%)
Mutual labels:  oauth
Diber-backend
Delivery Service - Spring Boot / Spring Data Jpa / Hibernate / PostgreSQL / OAuth2 Application
Stars: ✭ 22 (-48.84%)
Mutual labels:  oauth
jax-rs-pac4j
Security library for JAX-RS and Jersey
Stars: ✭ 48 (+11.63%)
Mutual labels:  oauth
servicenow-powershell
PowerShell module to automate ServiceNow service and asset management. This module can be used standalone, with Azure Automation, or Docker.
Stars: ✭ 310 (+620.93%)
Mutual labels:  oauth
okta-microservice-security-examples
Demos from Oktane18: API and Microservices Best Practices
Stars: ✭ 17 (-60.47%)
Mutual labels:  oauth

Socialiter for Laravel

socialiter-masthead

Supporting This Package

This is an MIT-licensed open source project with its ongoing development made possible by the support of the community. If you'd like to support this, and our other packages, please consider sponsoring us via the button above.

We thank the following sponsors for their generosity, please take a moment to check them out:

Table of Contents

Requirements

  • PHP 7.2+
  • Laravel 7.x
  • Socialite 4.2+

Installation

  1. Install the composer package:

    composer require genealabs/laravel-socialiter
  2. Add the social credentials table:

    php artisan migrate

    To prevent automatic migrations from running (for example if you have a different migration setup, like multi-tenancy, etc.), add the following entry to your app's service provider:

    <?php
    
    namespace App\Providers;
    
    use GeneaLabs\LaravelSocialiter\Socialiter;
    use Illuminate\Support\ServiceProvider;
    
    class AppServiceProvider extends ServiceProvider
    {
        public function register()
        {
            //
        }
    
        public function boot()
        {
            Socialiter::ignoreMigrations();
        }
    }

    And then publish the migration files and manipulate them as needed:

    php artisan vendor:publish --provider="GeneaLabs\LaravelSocialiter\Providers\ServiceProvider" --tag=migrations
  3. Update the user model:

    use GeneaLabs\LaravelSocialiter\Traits\SocialCredentials;
    
    class User extends Authenticatable {
    
        use SocialCredentials;
    
        ...
    }
    

Implementation

The following is an example controller implementation using the "Sign in with Apple" driver:

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use GeneaLabs\LaravelSocialiter\Socialiter;
use Illuminate\Http\RedirectResponse;
use Laravel\Socialite\Facades\Socialite;

class SignInWithAppleController extends Controller
{
    public function redirectToProvider() : RedirectResponse
    {
        // use Socialite, as before
        return Socialite::driver("sign-in-with-apple")
            ->scopes(["name", "email"])
            ->redirect();
    }

    public function handleProviderCallback()
    {
        // but handle the callback using Socialiter
        $user = (new Socialiter)
            ->driver("sign-in-with-apple")
            ->login();

        // or you can use the facade:
        $user = Socialiter::driver("sign-in-with-apple")
            ->login();

        // or you can use the app binding:
        $user = app("socialiter")
            ->driver("sign-in-with-apple")
            ->login();
    }
}

Commitment to Quality

During package development I try as best as possible to embrace good design and development practices, to help ensure that this package is as good as it can be. My checklist for package development includes:

  • Achieve as close to 100% code coverage as possible using unit tests.
  • Eliminate any issues identified by SensioLabs Insight and Scrutinizer.
  • Be fully PSR1, PSR2, and PSR4 compliant.
  • Include comprehensive documentation in README.md.
  • Provide an up-to-date CHANGELOG.md which adheres to the format outlined at http://keepachangelog.com.
  • Have no PHPMD or PHPCS warnings throughout all code.

Contributing

Please observe and respect all aspects of the included Code of Conduct.

Reporting Issues

When reporting issues, please fill out the included template as completely as possible. Incomplete issues may be ignored or closed if there is not enough information included to be actionable.

Submitting Pull Requests

Please review the Contribution Guidelines. Only PRs that meet all criterium will be accepted.

If you ❤️ open-source software, give the repos you use a ⭐️.

We have included the awesome symfony/thanks composer package as a dev dependency. Let your OS package maintainers know you appreciate them by starring the packages you use. Simply run composer thanks after installing this package. (And not to worry, since it's a dev-dependency it won't be installed in your live environment.)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].