Code Monkey home page Code Monkey logo

msudak / laravel-social-email-authentication Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masterpowers/laravel-social-email-authentication

0.0 2.0 0.0 971 KB

Laravel 5.3 bootstrap app with Multi Auth, Social and Email Authentication. Google re-Captcha, Facebook, Twitter, G+ and much more..

Home Page: https://tuts.codingo.me/laravel-social-and-email-authentication

PHP 75.78% JavaScript 0.92% ApacheConf 0.28% CSS 0.06% HTML 22.96%

laravel-social-email-authentication's Introduction

Laravel Social and Email Authentication

This project is related to tutorial from Codingo Tuts, you can checkout Live Demo Here โšก.

In the tutorial I am creating Laravel application with email authentication and user roles, but I am also using [Laravel Socialite] for Facebook, Twitter, Google+ and GitHub logins. At the end of this tutorial you will be able to use any other social provider in matter of seconds.

Application posses built-in email activation service, which can be stopped or started by changing ACTIVATION flag in .env file.

On registration form via email, users are required to complete Google Re-captcha.

Frontend uses Bootstrap 4 and Material Design for Bootstrap free theme.

Login Page Design

What is covered

Everything is covered there so new Laravel developers can grasp it quickly. I am following simple plan while I am developing:

This plan is not strict and if you are familiar with something you may just skip that part.

Implementing new Social Providers in under 20 seconds

Main beauty is modular approach in implementing new Socialite providers. Application uses 2 routes one for redirecting user to certain social site and other to accept response from that site:

$s = 'social.';
Route::get('/social/redirect/{provider}',   ['as' => $s . 'redirect',   'uses' => 'Auth\SocialController@getSocialRedirect']);
Route::get('/social/handle/{provider}',     ['as' => $s . 'handle',     'uses' => 'Auth\SocialController@getSocialHandle']);

To add new social provider you just need to insert new element in services.php like this:

    'facebook' => [
        'client_id'     => env('FB_ID'),
        'client_secret' => env('FB_SECRET'),
        'redirect'      => env('FB_REDIRECT')
    ],

    'twitter' => [
        'client_id'     => env('TW_ID'),
        'client_secret' => env('TW_SECRET'),
        'redirect'      => env('TW_REDIRECT')
    ],

And now you need to create new login link using following route:

route('social.redirect', ['provider' => 'provider_key_from_services']); //example
route('social.redirect', ['provider' => 'facebook']);
route('social.redirect', ['provider' => 'twitter']);

Todo's

Project is not over, I will publish few more tutorials regarding this matter. You can expect:

  • Handling when user disallows social app access
  • Taking emails of users who sign-up over Twitter and other providers which don't share that data
  • User account actions, like change password, change email etc

laravel-social-email-authentication's People

Contributors

ivanderbu2 avatar bryant1410 avatar sunnepah avatar

Watchers

James Cloos avatar Mariusz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.