2017 © Pedro Peláez
 

package laravel-magic-auth

Package for implementing magical authentication (URL and token) in Laravel 5.2+

image

montopolis/laravel-magic-auth

Package for implementing magical authentication (URL and token) in Laravel 5.2+

  • Wednesday, November 22, 2017
  • by coreymcmahon
  • Repository
  • 2 Watchers
  • 5 Stars
  • 46 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 10 % Grown

The README.md

Laravel Magic Auth package

Package for implementing Slack-style "magic auth" links in Laravel, (*1)

Set up

Install the package via composer

$ composer require montopolis/laravel-magic-auth

Add the service provider

In config/app.php inside the providers array..., (*2)

    /*
     * Application Service Providers...
     */
    App\Providers\AppServiceProvider::class,
    App\Providers\AuthServiceProvider::class,
    App\Providers\EventServiceProvider::class,
    App\Providers\RouteServiceProvider::class,

    /*
     * Third-party Service Providers...
     */
    Montopolis\MagicAuth\Providers\ServiceProvider::class,

Publish (and update) configuration

$ php artisan vendor:publish
$ vi config/montopolis_magic_auth.php

API

Create a token

Use this endpoint to trigger creation of an OTP for the user. The user will be notified via the preselected channel (see montopolis_magic_auth.php) with either the password, a magic auth link or both (also see config)., (*3)

POST magic-auth/create
{
    "email": "johnny@depp.com",
    "_token": "ABCDEFghijklmnOPQRStuvwxyz1234567890"
}

200 OK
{
    "message": {
        "email": "johnny@depp.com"
    }
}

Verify a token

After the OTP has been received and forwarded by the user, you can attempt authentication using this endpoint:, (*4)

POST magic-auth/verify
{
    "email": "johnny@depp.com",
    "_token": "ABCDEFghijklmnOPQRStuvwxyz1234567890",
    "key": "12345"
}

301 Redirect

Note: After posting to this endpoint, the Laravel session will be authenticated (if successful)., (*5)

The user can also be redirected as such to automatically sign them in:, (*6)

GET magic-auth/login?email=johnny@depp.com&_token=ABCDEFghijklmnOPQRStuvwxyz1234567890&key=12345

301 Redirect

License

Laravel Magic Auth is open-sourced software licensed under the MIT license., (*7)

The Versions

22/11 2017

dev-master

9999999-dev

Package for implementing magical authentication (URL and token) in Laravel 5.2+

  Sources   Download

MIT

The Requires

 

by Corey Mcmahon
by Babul Mukherjee

laravel authentication otp magic slack

22/11 2017

1.5.0

1.5.0.0

Package for implementing magical authentication (URL and token) in Laravel 5.2+

  Sources   Download

MIT

The Requires

 

by Corey Mcmahon
by Babul Mukherjee

laravel authentication otp magic slack

22/11 2017

1.4.0

1.4.0.0

Package for implementing magical authentication (URL and token) in Laravel 5.2+

  Sources   Download

MIT

The Requires

 

by Corey Mcmahon
by Babul Mukherjee

laravel authentication otp magic slack

21/11 2017

1.3.0

1.3.0.0

Package for implementing magical authentication (URL and token) in Laravel 5.2+

  Sources   Download

MIT

The Requires

 

by Corey Mcmahon
by Babul Mukherjee

laravel authentication otp magic slack

04/07 2016

1.2.0

1.2.0.0

Package for implementing magical authentication (URL and token) in Laravel 5.2+

  Sources   Download

MIT

The Requires

 

by Corey Mcmahon
by Babul Mukherjee

laravel authentication otp magic slack