spomky-labs/oauth2-server-scope-manager-bundle

此包已被放弃,不再维护。作者建议使用 spomky-labs/oauth2-server-bundle 包。

Symfony2 OAuth2 服务器作用域管理器包

v5.0.1 2015-06-15 20:27 UTC

This package is not auto-updated.

Last update: 2015-08-17 10:43:29 UTC


README

Scrutinizer Code Quality Build Status HHVM Status PHP 7 ready

SensioLabsInsight

Latest Stable Version Total Downloads Latest Unstable Version License

此包为您的 OAuth2 服务器提供简单的范围管理器。

它依赖于 OAuth2 接口项目

发布流程

发布流程 在此描述

先决条件

此包需要至少 PHP 5.4Symfony v2.3

它已成功测试使用以下版本:

  • PHP: PHP 5.4PHP 5.6PHP 7HHVM
  • Symfony: v2.3.xv2.7.x

安装

安装此库的首选方法是依赖 Composer

composer require "spomky-labs/oauth2-server-scope-manager-bundle" "~5.0.0"

启用包

在内核中启用包

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        ...
        new SpomkyLabs\OAuth2ServerScopeManagerBundle\SpomkyLabsOAuth2ServerScopeManagerBundle(),
    );
}

配置

sl_oauth2_scope_manager:
    policy: default # Available policies:
                    # - 'default': uses default_scope if no scope is requested,
                    # - 'error': throws an error if no scope is requested,
                    # - null (default): no scope policy
    default_scope: scope1 scope2 # These scopes will be set if the policy is 'default' and no scope is requested (default: null)
    available_scope: scope1 scope2 scope3 scope4 # Scopes supported by the server (default: null)

使用方法

您只需要注入此包提供的管理器: sl_oauth2_scope_manager.manager

贡献

欢迎提出新功能、错误修复以及其他使此包有用的想法。请 遵循这些最佳实践

许可证

此包在 MIT 许可证 下发布。