承接 linkorb/flex-auth-provider 相关项目开发

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

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

linkorb/flex-auth-provider

最新稳定版本:v1.3.2

Composer 安装命令:

composer require linkorb/flex-auth-provider

包简介

Silex service provider for including FlexAuth library.

关键字:

README 文档

README

FlexAuth: Silex provider

FlexAuthProvider provider integration FlexAuth library to Silex framework.

Using

use Silex\Application;

$app = new Application();

//....

$app->register(new \Silex\Provider\SessionServiceProvider());
$app->register(new \FlexAuthProvider\FlexAuthProvider());

// define login page for redirect if jwt authentication is failed via browser 
$app['flex_auth.jwt.redirect_login_page'] = "/login";

$app['security.user_provider.main'] = function ($app) {
    return $app['flex_auth.security.user_provider'];
};

$app->register(new Silex\Provider\SecurityServiceProvider(), [
    'security.firewalls' => [
        'main' => [
            # https://silex.symfony.com/doc/2.0/cookbook/guard_authentication.html
            'guard' => [
                'authenticators' => [
                    'flex_auth.type.jwt.security.authenticator'
                ],
            ],
            'form' => [
                'login_path' => '/login',
                'default_target_path' => '/',
                'check_path' => '/login_check'
            ],
            'logout' => [
                'logout_path' => '/logout',
                'target_url' => 'homepage',
                'invalidate_session' => true
            ],
            'anonymous' => true,
        ],
    ],
]);
$app['security.default_encoder'] = function ($app) {
    return $pimple['flex_auth.security.password_encoder'];
    // return new \Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder();
};

Links

Silex demo

The Security Component(Symfony Docs)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-03-11