A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package

Overview

laravel-social

Latest Version on Packagist Total Downloads Monthly Downloads Daily Downloads Latest Stable Version Software License Build Status Quality Score StyleCI

A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package.

Installation

Using adminlte laravel (recommended option)

Install AdminLTE Laravel package:

composer global require "acacha/adminlte-laravel-installer"
laravel new awesome
cd awesome
adminlte-laravel install
adminlte-laravel social

Then optionally you can boostrap you project in your favourite browser using:

llum boot

Using composer

Use Composer, in you Laravel project:

$ composer require acacha/laravel-social

Add service provider to providers array in your config/app.php file:

Acacha\LaravelSocial\Providers\LaravelSocialServiceProvider::class

And run command:

php artisan make:social

To configure social network providers.

Finally modify your app views to add links to Social Login using link:

http://yourappurl.com/auth/{socialnetwork}

Examples:

http://yourappurl.com/auth/github
http://yourappurl.com/auth/facebook
http://yourappurl.com/auth/google
http://yourappurl.com/auth/twitter
http://yourappurl.com/auth/linkedin

I recommend you to use AdminLTE Laravel Package for a full working Auth scaffolding with Adminlte bootstrap template. See previous section.

You can also use Laravel default Auth scaffolding running command:

php artisan make:auth

And manually add button/links to social Login/Register.

Usage

You can configure Social Providers with command:

php artisan acacha:social
 Which social network you wish to configure? [Github]:
  [0] Github
  [1] Facebook
  [2] Google
  [3] Twitter
  [4] Linkedin
 > 0
  
  Configuring social network Github...
  Please register a new OAuth app for Github. Go to URL https://github.com/settings/applications/new
  Then ask the following questions:
  
   OAuth client id?:
   > 3a1fg6ac5437f9f4cebd
   
   OAuth client secret?:
   > 5919185e3fb7024e5b10cedce5cce408893224d         
   
   OAuth client redirect URL? [http://localhost:8080/auth/github/callback]:
   > 
   
  File /home/sergi/Code/socialAdminLTEtest/config/services.php updated.
  Github added to config/services.php file
  
   Do you wish to configure other social networks? (yes/no) [yes]: 

This wizard will adapt your .env and config/services.php files to add your social networks OAuth data.

At this moment command php artisan acacha:social will not check if you have already configured your social network so be carefull when executing this command in already configured projects (no errors will be thrown but you will have repeated data in your config files).

Requirements

Please install AdminLTE Laravel:

composer global require "acacha/adminlte-laravel-installer"

This package also requires (all installed using composer):

See also related projects:

Social networks

Laravel social package support by default the following social networks:

  • Github
  • Facebook
  • Google
  • Twitter
  • Linkedin

Laravel social use Illuminate\Support\Manager so you can create your own driver and register the driver in LaravelSocialServiceProvider.

Please, if you create a new driver feel free to create a Pull Request.

You can enable/disable social providers easily. See following section.

Enable/disable social providers

At class LaravelSocialServiceProvider you can modify $enabled field to change enabled social providers. Also remember to changes your views to add/remove action/links to social auth.

Also you have to change static variable $socialNetworks in file ConfigureSocialServicesManager to add your extra social providers.

Github

The cli wizard will propose you to go to page:

https://github.com/settings/applications/new

to register new OAuth Application.

Facebook

The cli wizard will propose you to go to page:

https://developers.facebook.com/apps/

to register new OAuth Application

Google

The cli wizard will propose you to go to page:

https://console.developers.google.com

to register new OAuth Application. Please remember to active Google+ API!.

More info at https://developers.google.com/identity/sign-in/web/devconsole-project .

Twitter

The cli wizard will propose you to go to page:

https://apps.twitter.com/app/new

to register new OAuth Application. Retrieve your api keys at tab Keys and Access Tokens and remember to check Request email addresses from users checkbox active in Permissions tab.

Linkedin

The cli wizard will propose you to go to page:

https://www.linkedin.com/secure/developer

to register new OAuth Application.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

In your Laravel project execute:

$ phpunit tests/AcachaLaravelSocial.php

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

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

Credits

License

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

You might also like...
Braindead simple social login with Laravel and Eloquent.
Braindead simple social login with Laravel and Eloquent.

Important: This package is not actively maintained. For bug fixes and new features, please fork. Eloquent OAuth Use the Laravel 4 wrapper for easy int

Login Social and product store

Run Stores Fake Marvel store This is a fake Marvel Store, here you can find a list of all the Marvel characters and simulate a shopping of its product

OAuth server implementation for WP API

WP REST API - OAuth 1.0a Server Connect applications to your WordPress site without ever giving away your password. This plugin uses the OAuth 1.0a pr

A Collection of Providers for Laravel Socialite

A Collection of Providers for Laravel Socialite Documentation Full documentation for using these providers can be found at the Documentation. Contribu

⚡️ Easiest way to implement Socialite for Laravel Jetstream.

Introduction Installation Usage & Setup Generating the redirect Resolving users Handling Invalid State Create account on first login Log in on registr

Hej! is a simple authentication boilerplate for Socialite.
Hej! is a simple authentication boilerplate for Socialite.

Hej! - a Socialite authentication flow implementation Hej! is a simple authentication flow implementation for Socialite. Out-of-the-box, Hej! can help

Creamos un inicio de sesión desde Facebook para nuestra aplicación web utilizando la librería de Socialite

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

It's authorization form, login button handler and login to your personal account, logout button
It's authorization form, login button handler and login to your personal account, logout button

Authorization-form It's authorization form, login button handler and login to your personal account, logout button Each file is: header.php - html-fil

An OAuth 2.0 bridge for Laravel and Lumen [DEPRECATED FOR LARAVEL 5.3+]
An OAuth 2.0 bridge for Laravel and Lumen [DEPRECATED FOR LARAVEL 5.3+]

OAuth 2.0 Server for Laravel (deprecated for Laravel 5.3+) Note: This package is no longer maintaned for Laravel 5.3+ since Laravel now features the P

Comments
  • Socialite Manager Error

    Socialite Manager Error

    I was install laravel social look like documentation and i install social media app facebook but if i want to acess its give error message : "Type error: Argument 1 passed to Laravel\Socialite\SocialiteManager::formatRedirectUrl() must be of the type array, null given, called in

    scerror

    I used laravel 5.5 latest

    Apache version: Apache/2.4.29 PHP version: 7.1.9 MySQL version: 10.1.28-MariaDB

    opened by hai-ru 4
  • Numeric value out of range: 1264 Out of range value for column 'social_id' at row 1 Facebook Login

    Numeric value out of range: 1264 Out of range value for column 'social_id' at row 1 Facebook Login

    QueryException in Connection.php line 647: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'social_id' at row 1 (SQL: insert into social_users (user_id, social_id, social_type, nickname, name, email, avatar, meta, updated_at, created_at) values (6,

    opened by acacha 4
  • sql error

    sql error

    [Illuminate\Database\QueryException]
    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json nul
    l, created_at timestamp null, updated_at timestamp null) default cha' at line 1 (SQL: create table social_users (id int unsigned not null auto_increment primary key, user_id int unsigned no
    t null, social_id varchar(191) not null, social_type varchar(191) not null, nickname varchar(191) null, name varchar(191) null, email varchar(191) not null, avatar varchar(191) null, met a json null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)

    [Doctrine\DBAL\Driver\PDOException]
    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json nul
    l, created_at timestamp null, updated_at timestamp null) default cha' at line 1

    [PDOException]
    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json nul
    l, created_at timestamp null, updated_at timestamp null) default cha' at line 1

    opened by zerocooldeveloper 2
  • Linkedin added

    Linkedin added

    Description

    I've added linkedin.

    Motivation and context

    Many people use linkedin, also I have a project where it have to be used.

    How has this been tested?

    I added it to my local website and it works fine.

    Types of changes

    What types of changes does your code introduce? Put an x in all the boxes that apply:

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [x] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to change)

    Checklist:

    Go over all the following points, and put an x in all the boxes that apply.

    Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.

    • [x] I have read the CONTRIBUTING document.
    • [x] My pull request addresses exactly one patch/feature.
    • [x] I have created a branch for this patch/feature.
    • [x] Each individual commit in the pull request is meaningful.
    • [ ] I have added tests to cover my changes.
    • [x] If my change requires a change to the documentation, I have updated it accordingly.

    If you're unsure about any of these, don't hesitate to ask. We're here to help!

    opened by alexeydemin 2
Owner
Sergi Tur Badenas
Computer Science Teacher and Open Source contributor in my free time. Creator of adminlte-laravel. Newsletter: https://sergiturbadenas.ck.page/797d91fd9b
Sergi Tur Badenas
A complete Login and Register page using a Mysql Database and php

Login With Mysql A complete Login and Register page using a Mysql Database ?? Built with ⚙️ ?? Description A login with Frontend, Backend and Database

Marc Medrano 1 Nov 5, 2021
PHPoAuthLib provides oAuth support in PHP 7.2+ and is very easy to integrate with any project which requires an oAuth client.

PHPoAuthLib NOTE: I'm looking for someone who could help to maintain this package alongside me, just because I don't have a ton of time to devote to i

David Desberg 1.1k Dec 27, 2022
EAuth extension allows to authenticate users by the OpenID, OAuth 1.0 and OAuth 2.0 providers

EAuth extension allows to authenticate users with accounts on other websites. Supported protocols: OpenID, OAuth 1.0 and OAuth 2.0.

Maxim Zemskov 330 Jun 3, 2022
Login & Register using laravel 8

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Georgy Octavianus Fernando 1 Nov 16, 2021
Laravel wrapper around OAuth 1 & OAuth 2 libraries.

Introduction Laravel Socialite provides an expressive, fluent interface to OAuth authentication with Facebook, Twitter, Google, LinkedIn, GitHub, GitL

The Laravel Framework 5.2k Dec 27, 2022
OAuth 1/2 Provider implementations for chillerlan/php-oauth-core. PHP 7.4+

chillerlan/php-oauth-providers Documentation See the wiki for advanced documentation. Requirements PHP 7.4+ a PSR-18 compatible HTTP client library of

chillerlan 4 Dec 2, 2022
Social OAuth Authentication for Laravel 5. drivers: facebook, github, google, linkedin, weibo, qq, wechat and douban

Social OAuth Authentication for Laravel 5. drivers: facebook, github, google, linkedin, weibo, qq, wechat and douban

安正超 330 Nov 14, 2022
Register ,Login , Logout , having access control

Helo what's up dude read by the name of creator lov3yp :D This script is inspired by Lov3yp#2018 And Burak karahan Installation steps: !- Import the s

Lov3yp 2 Nov 1, 2021
Open source social sign on PHP Library. HybridAuth goal is to act as an abstract api between your application and various social apis and identities providers such as Facebook, Twitter and Google.

Hybridauth 3.7.1 Hybridauth enables developers to easily build social applications and tools to engage websites visitors and customers on a social lev

hybridauth 3.3k Dec 23, 2022
Automatically fill in the captcha code in the NTHU OAuth login page.

NTHU-OAuth-Decaptcha Automatically fill in the captcha code in the NTHU OAuth login page. CNN Decaptcha For training the decaptcha model. See CNN Deca

null 18 Dec 4, 2022