承接 mckenziearts/laravel-oauth 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mckenziearts/laravel-oauth

Composer 安装命令:

composer require mckenziearts/laravel-oauth

包简介

Social OAuth authentication for Laravel 5. Drivers: Facebook, Twitter, Google, LinkedIn, Github

README 文档

README

Latest Version on Packagist Total Downloads Build Status Scrutinizer Code Quality StyleCI

Introduction

Social OAuth authentication for Laravel 5 which provides oAuth support in PHP 5.3+ and is very easy to integrate with any project which requires an oAuth client. This package use Laravel Socialite. For Laravel 4 look this package

Supported services

The library supports OAuth 2.0 compliant services. A list of currently implemented services can be found below. More services will be implemented soon.

Included service implementations:

  • OAuth2
    • Facebook
    • GitHub
    • Google
    • Instagram
    • LinkedIn
    • Bitbucket
    • Twitter
    • Dribbble
    • Pinterest
    • Youtube
    • Gitlab
  • more to come!

Laravel Support version

Laravel laravel-oauth
<=5.5 ^1.0
6.0 ^1.1

Installation

  1. Include the package in your project using Composer
$ composer require mckenziearts/laravel-oauth
  1. Add the service provider to your config/app.php providers array:

    For Laravel 5.5.+ - you're done.

Mckenziearts\LaravelOAuth\LaravelOAuthServiceProvider::class,
  1. Publish the Vendor Assets files by running:
php artisan vendor:publish --provider="Mckenziearts\LaravelOAuth\LaravelOAuthServiceProvider"
  1. Now that we have published a few new files to our application we need to reload them with the following command:
composer dump-autoload

Configuration

When you published the vendor assets you added a new file inside of your config folder which is called config/laravel-oauth.php. This file contains a bunch of configuration you can use to configure your connexion using social networks.

First, you have to add your service like is defined on The official documentation of Socialite available here. Just setup your Oauth services for your application. Laravel/socialite is automatically installed by this package.

Usage

  1. Fisrt of all in the config/laravel-oauth.php file you must define the default users table name to simplify migrations. By default users table is used
'users' => [
    'table'   => 'users',
],
  1. Secondly you must specify the providers to use for social login in the providers array. To active a provider set the value to true
  'providers' => [
    'facebook'  => true,
    'google'    => true,
    'github'    => true,
  ],

The last configuration is to stylize the button by editing class name and add or remove icon

Next, if you may want to re-publish the laravel-oauth assets, config, and the migrations run the following command:

php artisan vendor:publish --tag=laravel-oauth.assets --force
php artisan vendor:publish --tag=laravel-oauth.config --force
php artisan vendor:publish --tag=laravel-oauth.migrations --force
  1. Next to make sure you have the latest database schema run:
php artisan migrate
  1. Inside of your master.blade.php file include a header yield. Inside the head of your master or app.blade.php add the following:
@yield('css')
  1. Add the blade directive to your view where you want to display the socials buttons. The directive takes a parameter login to display the login text or resgister for the text related to the registration
@socialite('login')
  1. Add the style of the buttons by adding this to your view in the section in the @yield('css') who defined in your master layout
@section('css')
    <link href="{{ url('/vendor/mckenziearts/laravel-oauth/assets/css/socialite.css') }}" rel="stylesheet">
@endsection
  1. In the Auth\LoginController of your application, add the OAuthSocialite trait:
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Mckenziearts\LaravelOAuth\Traits\OAuthSocialite;

class LoginController extends Controller
{
    use OAuthSocialite;
    ..

With this feature you can overwrite the present methods on the trait if you want to customize them even more

  1. Add this routes to your default web route file
Route::get('/auth/{provider}', 'Auth\LoginController@redirectToProvider');
Route::get('/callback/{provider}', 'Auth\LoginController@handleProviderCallback');

Change log

Please see the changelog.md for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email monneylobe@gmail.com instead of using the issue tracker.

Credits

License

MIT. Please see the license.md for more information.

mckenziearts/laravel-oauth 适用场景与选型建议

mckenziearts/laravel-oauth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 169 次下载、GitHub Stars 达 52, 最近一次更新时间为 2018 年 06 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「oauth」 「laravel」 「laravel-socialite」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 mckenziearts/laravel-oauth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mckenziearts/laravel-oauth 我们能提供哪些服务?
定制开发 / 二次开发

基于 mckenziearts/laravel-oauth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 169
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 52
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 52
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-30