security:
    encoders:
        Authbucket\Bundle\OAuth2Bundle\Tests\TestBundle\Entity\User:    plaintext
        Symfony\Component\Security\Core\User\User:                      plaintext

    providers:
        default:
            entity:                 { class: TestBundle:User }

        admin:
            memory:
                users:
                    admin:          { roles: 'ROLE_ADMIN', password: secrete }

    firewalls:
        admin:
            pattern:                ^/admin
            http_basic:             ~
            provider:               admin

        oauth2_login:
            pattern:                ^/oauth2/login$
            anonymous:              ~

        oauth2_authorize:
            pattern:                ^/oauth2/authorize
            remember_me:
                key:                "%kernel.secret%"
            form_login:
                login_path:         /oauth2/login
                check_path:         /oauth2/authorize/login_check
            logout:
                path:               /oauth2/authorize/logout
                target:             /demo
            provider:               default

        api_oauth2_authorize:
            pattern:                ^/api/v1.0/oauth2/authorize$
            http_basic:             ~
            provider:               default

        api_oauth2_token:
            pattern:                ^/api/v1.0/oauth2/token$
            oauth2_token:           ~

        api_oauth2_debug:
            pattern:                ^/api/v1.0/oauth2/debug$
            oauth2_resource:        ~

        api_resource_model:
            pattern:                ^/api/v1.0/resource/model$
            oauth2_resource:
                resource_type:      model
                scope:              [ demoscope1 ]

        api_resource_debug_endpoint:
            pattern:                ^/api/v1.0/resource/debug_endpoint$
            oauth2_resource:
                resource_type:      debug_endpoint
                scope:              [ demoscope1 ]
                options:
                    debug_endpoint: '/api/v1.0/oauth2/debug'
                    cache:          false

        api_resource_debug_endpoint_cache:
            pattern:                ^/api/v1.0/resource/debug_endpoint/cache$
            oauth2_resource:
                resource_type:      debug_endpoint
                scope:              [ demoscope1 ]
                options:
                    debug_endpoint: '/api/v1.0/oauth2/debug'
                    cache:          true

        api_resource_debug_endpoint_invalid_options:
            pattern:                ^/api/v1.0/resource/debug_endpoint/invalid_options$
            oauth2_resource:
                resource_type:      debug_endpoint
                scope:              [ demoscope1 ]
                options:
                    debug_endpoint: ''
                    cache:          true
