定制 liberty_code/authentication 二次开发

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

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

liberty_code/authentication

最新稳定版本:v1.0.0

Composer 安装命令:

composer require liberty_code/authentication

包简介

Library

README 文档

README

Description

Library contains authentication components, to manage identification and authentication system.

Requirement

  • Script language: PHP: version 7 || 8

Installation

Several ways are possible:

Composer

  1. Requirement

    It requires composer installation. For more information: https://getcomposer.org

  2. Command: Move in project root path

     cd "<project_root_path>"
    
  3. Command: Installation

     php composer.phar require liberty_code/authentication ["<version>"]
    
  4. Note

    • Include vendor

      If project uses composer, vendor must be included:

        require_once('<project_root_path>/vendor/autoload.php');
      
    • Configuration

      Installation command allows to add, on composer file "/composer.json", following configuration:

        {
            "require": {
                "liberty_code/authentication": "<version>"
            }
        }
      

Include

  1. Download

    • Download following repository.
    • Put it on repository root path.
  2. Include source

     require_once('<repository_root_path>/include/Include.php');
    

Usage

Authentication

Authentication provides identification and authentication information, about one specific entity.

Elements

  • Authentication

    Allows to design an authentication, to get all identification and authentication information, about one specific entity.

  • SecretAuthentication

    Extends authentication features. Uses identifier, as identification information and secret, as authentication information.

  • TokenAuthentication

    Extends authentication features. Uses token, as identification and authentication information.

  • CredentialAuthentication

    Extends authentication features. Uses credential to retrieve identifier, as identification and secret, as authentication information.

Example

// Get secret authentication
use liberty_code\authentication\authentication\secret\model\SecretAuthentication;
$secretAuth = new SecretAuthentication();
$secretAuth->setIdentifier(...);
$secretAuth->setSecret(...);
...
// Get array of identification data
var_dump($secretAuth->getTabIdData());
...
// Get array of authentication data
var_dump($secretAuth->getTabAuthData());
...

Authenticator

Authenticator is authentication support, allows to check identification and authentication, from a specified authentication.

Elements

  • Authenticator

    Allows to design an authenticator, to check identification and authentication, from a specified authentication.

Agent

Agent allows to represent authentication about one specific entity, to check its identification and its authentication.

Elements

  • Agent

    Allows to design an agent, to check identification and authentication, about one specific entity.

  • FixAgent

    Extends agent features. Allows to check identification and authentication, about one specific entity, from a specified fixed configuration.

Example

// Get agent
use liberty_code\authentication\agent\model\DefaultAgent;
$agent= new DefaultAgent(
    $secretAuth, 
    ...(authenticator object)
);
...
// Check is identified
var_dump($agent->checkIsIdentified());
...
// Check is authenticated
var_dump($agent->checkIsAuthenticated());
...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-01-14