kawax / socialite-amazon by revolution

Socialite for Login with Amazon
4,396
5
1
Package Data
Maintainer Username: revolution
Maintainer Contact: kawaxbiz@gmail.com (kawax)
Package Create Date: 2017-09-13
Package Last Update: 2019-04-14
Language: PHP
License: MIT
Last Refreshed: 2019-07-20 15:46:00
Package Statistics
Total Downloads: 4,396
Monthly Downloads: 336
Daily Downloads: 8
Total Stars: 5
Total Watchers: 1
Total Forks: 2
Total Open Issues: 0

Socialite for Login with Amazon

https://login.amazon.com/

Installation

composer require revolution/socialite-amazon

config/services.php

    'amazon' => [
        'client_id'     => env('AMAZON_LOGIN_ID'),
        'client_secret' => env('AMAZON_LOGIN_SECRET'),
        'redirect'      => env('AMAZON_LOGIN_REDIRECT'),
    ],

.env

AMAZON_LOGIN_ID=
AMAZON_LOGIN_SECRET=
AMAZON_LOGIN_REDIRECT=

Usage

routes/web.php

Route::get('/', 'AmazonController@index');
Route::get('callback', 'AmazonController@callback');

AmazonController

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Laravel\Socialite\Facades\Socialite;

class AmazonController extends Controller
{
    public function index()
    {
        return Socialite::driver('amazon')->redirect();
    }

    public function callback()
    {
        $user = Socialite::driver('amazon')->user();
        dd($user);
    }
}

LICENCE

MIT Copyright (c) 2017 kawax