定制 delboy1978uk/bone-social-auth 二次开发

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

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

delboy1978uk/bone-social-auth

Composer 安装命令:

composer require delboy1978uk/bone-social-auth

包简介

SocialAuth package for Bone Framework

README 文档

README

Latest Stable Version build status Code Coverage Scrutinizer Code Quality License

SocialAuth package for Bone Framework using HybridAuth

installation

Use Composer

composer require delboy1978uk/bone-social-auth

Simply add to the config/packages.php after the Bone User Package

<?php

// use statements here
use Bone\SocialAuth\SocialAuthPackage;

return [
    'packages' => [
        // packages here...,
        SocialAuthPackage::class,
    ],
    // ...
];

settings

Create a settings file in the config/ folder called bone-social-auth.php:

return [
    'bone-social-auth' => [
        'callback' => 'https://awesome.scot/user/login/via',
        'providers' => [
            'X' => [
                'enabled' => true,
                'keys' => [
                    'id' => '...',
                    'secret' => '...',
                ]
            ],
            'Google' => [
                'enabled' => true,
                'keys' => [
                    'id' => '...',
                    'secret' => '...',
                ]
            ],
            'Github' => [
                'enabled' => true,
                'keys' => [
                    'id' => '...',
                    'secret' => '...',
                ]
            ],
            'Facebook' => [
                'enabled' => true,
                'keys' => [
                    'key' => '...',
                    'secret' => '...',
                ]
            ],
        ],
         'custom' => [
             // use this config to auth with your own Bone FrameworkOAuth2 server
            'providers' => [
                'Boneframework' => [
                    'adapter' => \Bone\SocialAuth\Provider\BoneFrameworkProvider::class,
                    'enabled' => true,
                    'keys' => [
                        'id' => '32815de2c0a25d239ff0585674c938a9',
                        'secret' => 'JDJ5JDEyJC9iT3hXVjRCeTdJL2ZPSlZOd2xFRnVPZ09KNW9GL2RDV2I0dTcwdUNnNWpHcGt2SXQzdWJL',
                    ],
                    'icon' => 'bone',
                    'color' => 'black'
                ],
            ],
        ],
    ],
];

usage

You will probably want to have the social links on your /user/login link, so copy the View files from vendor/delboy1978uk/bone-user/View/BoneUser to the main App view src/View/BoneUser and add the followimg config to config/views.php in order to override them:

return [
    'views' => [
        'boneuser' => 'src/App/View/BoneUser',
    ],
];

In any view file, and if overriding bone-user then particularly src/App/View/BoneUser/login.php, you can call

<?= $this->socialAuth() ?>

which will display some links to log you in. Once logged in you will have a standard bone-user.

auth via a Bone Framework OAuth Server

Use the custom config above, you can extend Bone\SocialAuth\Provider\BoneFrameworkProvider and define the following :

    protected $scope = 'basic';
    protected $apiBaseUrl = 'https://boneframework.docker/api';
    protected $authorizeUrl = 'https://boneframework.docker/oauth2/authorize';
    protected $accessTokenUrl = 'https://boneframework.docker/oauth2/token';
    protected $callback = 'https://boneframework.docker/oauth2/token';

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固