0

I have set up FOSOauthServerBundle, I have my api and access token For now when I call /api?access_token=.... all I see is login page. My security.yml:

    security:
        firewalls:
            main:
                pattern: ^/
                form_login:
                    provider: fos_userbundle
                    csrf_provider: form.csrf_provider
                logout:       true
                anonymous:    true
            api:
                pattern: ^/api
                fos_oauth: true
                stateless: true
            oauth_authorize:
                pattern: ^/oauth/v2/auth
                form_login:
                    provider: fos_userbundle
                    check_path: /oauth/v2/auth_login_check
                    login_path: /oauth/v2/auth_login
                anonymous: true
            oauth_token:
                pattern: ^/oauth/v2/token
                security: false

        access_control:
            ...
            - { path: ^/api, roles: [ IS_AUTHENTICATED_FULLY ] }
dwilda
  • 83
  • 2
  • 12
  • is your /api path protected by another firewall in security.yml? if you could show more of your security.yml, it would help – Sehael Nov 18 '13 at 20:46

1 Answers1

0

Not sure what could cause that however I would recommend to replace following firewall:

main:
    pattern: ^/
    ...

with

main:
    pattern: ^/login$
    ...

This will map your firewall only for login page.

AlexHalkin
  • 1,088
  • 14
  • 33