michalkvasnicak/oauth2-server-mongodb-bundle

MongoDB模型层,用于OAuth 2.0服务器捆绑包

dev-develop 2014-10-27 15:06 UTC

This package is not auto-updated.

Last update: 2024-09-24 00:41:26 UTC


README

用于Symfony 2框架的OAuth 2.0服务器捆绑包的模型层。

  • 开发: Build Status
  • 主分支: Build Status
  • Coverage Status
  • Gittip
  • Flattr this git repo

需求

  • PHP >= 5.4
  • doctrine/mongodb-odm-bundle: ~3.0
  • symfony/security-bundle: >= ~2.5
  • michalkvasnicak/oauth2-server-bundle: dev-develop

安装

使用composer

{
    "require": {
        "michalkvasnicak/oauth2-server-mongodb-bundle": "dev-develop"
    }
}

配置

默认Doctrine ODM文档

要使用此捆绑包中的默认文档,只需在AppKernel.php中启用捆绑包。

自定义Doctrine ODM文档

如果您想创建自己的文档,则创建扩展此捆绑包中的抽象类的文档,并配置此捆绑包。

o_auth2_server_mongodb:
    document_classes:
        access_token: 'FQN of Access Token Doctrine ODM document'
        authorization_code: 'FQN of Authorization code Doctrine ODM document'
        client: 'FQN of Client Doctrine ODM document'
        refresh_token: 'FQN of Refresh Token Doctrine ODM document'
        user: 'FQN of User Doctrine ODM document'

    repository_classes:
        access_token: 'FQN of Access Token Doctrine ODM document repository'
        authorization_code: 'FQN of Authorization code Doctrine ODM document repository'
        client: 'FQN of Client Doctrine ODM document repository'
        refresh_token: 'FQN of Refresh Token Doctrine ODM document repository'
        user: 'FQN of User Doctrine ODM document repository'

    # scope document and repository is not defined because it is used only by other documents
    # but Scope has to implement OAuth2\Storage\IScope interface!