定制 werk365/laraveloauthclient 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

werk365/laraveloauthclient

Composer 安装命令:

composer require werk365/laraveloauthclient

包简介

Multi purpose OAuth client to use in Laravel

README 文档

README

Latest Version on Packagist Total Downloads StyleCI

Multi-purpose OAuth client, configurable for a sleuth of providers through the config file.

Installation

Via Composer

$ composer require werk365/laraveloauthclient

Usage

Publish the config

$ php artisan vendor:publish --provider="Werk365\LaravelOAuthClient\LaravelOAuthClientServiceProvider"

Configure the config using the provided example.

Then use the package as follows:

use Werk365\LaravelOAuthClient\LaravelOAuthClient as OAuth;

// ...

$oauth = new OAuth("vendorname");

// Returns array defined in config
$response = $oauth->getToken($code);

//Returns array defined in config
$response = $oauth->getInfo($accesstoken);

//Returns array defined in config
$response = $oauth->refreshToken($refreshtoken);

Config

Example of config provided, edit values to match vendor spec:

<?php

return [
    'vendor1' => [
        'client_id' => '1234',
        'client_secret' => '12345',
        'redirect_uri' => 'https://www.example.com/oauth2/vendor1',
        'token' => [
            'url' => 'https://login.vendor.example.com/oauth2/token',
            'method' => 'POST',
            'grant_type' => 'authorization_code',
            'fields' => [
                'access_token' => 'access_token',
                'expires_in' => 'expires_in',
                'refresh_token' => 'refresh_token',
            ],
            'auth' => 'body',
        ],
        'refresh' => [
            'url' => 'https://login.vendor.example.com/oauth2/token',
            'method' => 'POST',
            'grant_type' => 'authorization_code',
            'fields' => "*",
            'auth' => 'body',
        ],
        'info' => [
            'url' => 'https://login.vendor.example.com/oauth2/metadata',
            'method' => 'GET',
            'fields' => [
                'metadata1',
                'metadata2',
            ],
        ],
    ],
    'vendor2' => ['...'],
];

Change log

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

Testing

$ composer test

Security

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

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固