我已经设置了 FOSOauthServerBundle,我有我的 api 和访问令牌 现在,当我调用 /api?access_token=.... 时,我看到的只是登录页面。我的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 ] }