Home

Awesome

OAuth 2.0 Server MongoDB bundle

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

Requirements

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!