/oauth2-server-mongodb-bundle

MongoDB model layer for OAuth 2.0 server (Symfony 2 Framework)

Primary LanguagePHPMIT LicenseMIT

OAuth 2.0 Server MongoDB bundle

Model layer for OAuth 2.0 server bundle for Symfony 2 framework.

  • Develop: Build Status
  • Master: Build Status
  • Coverage Status
  • Gittip
  • Flattr this git repo

Requirements

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

Installation

Using composer

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

Configuration

Default Doctrine ODM Documents

To use default documents from this bundle just enable bundle in AppKernel.php.

Custom Doctrine ODM Documents

If you want to create your own documents then create documents that are extending abstract classes from this bundle and configure this bundle.

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!