承接 linkorb/silex-provider-user-basic 相关项目开发

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

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

linkorb/silex-provider-user-basic

Composer 安装命令:

composer require linkorb/silex-provider-user-basic

包简介

Custom Symfony Security User and in-memory User Provider for use in Silex apps.

README 文档

README

Custom Symfony Security User and in-memory User Provider for use in Silex apps.

First, create an array of users:-

// for example, in src/app.php
$users = [
    'jo' => [
        'password' => '$2y$12$G7...',
        'roles' => ['admin'],
        'display_name' => 'Joseph',
        'enabled' => false,
    ],
    'jen' => [
        'password' => '$2y$12$oD...',
        'roles' => ['admin'],
        'display_name' => 'Jenifer',
    ],
];

The password value is the hashed password; these can be generated with the accomapnying password hashing command:-

$ vendor/bin/hashpasswd -h
Usage:
  hashpasswd [options]
Options:
  -c, --cost=COST       Algorithmic cost of the hash function. [default: 12]
  -h, --help            Display this help message
Help:
  The command interactively asks for the password before printing its hash.

Next, register Silex's core SecurityServiceProvider and provide a firewall paramater:-

$app->register(
    new SecurityServiceProvider,
    [
        'security.firewalls' => [
            'api' => [
                'pattern' => '^/api',
                'http' => true,
                'users' => function () use ($users) {
                    return new \LinkORB\BasicUser\Provider\UserProvider($users);
                },
            ],
        ],
    ]
);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固