FOSOAuthServerBundle请求不存在的服务

时间:2014-07-10 13:43:27

标签: symfony fosuserbundle fosoauthserverbundle

我在整合FOSOAuthServerBundle时遇到了一些麻烦...

当我尝试访问oauth / v2 / token或使用我的控制器创建新客户端时出现此错误:

  

您已请求不存在的服务   \" fos_oauth_server.controller.token \

oauth / v2 / auth将我重定向到我的fos用户登录表单,所以我认为这没问题。

我的security.yml

  

提供商:           #my_fos_facebook_provider:               #id:my.facebook.user
          fos_userbundle:               id:fos_user.user_manager

firewalls:
    api:
        pattern: ^/api/.*
        fos_oauth: true
        stateless: true
        anonymous: false


    oauth_token:
        pattern:    ^/oauth/v2/token
        security:   false


    # -> custom firewall for the admin area of the URL
    admin:
        pattern:      /admin(.*)
        form_login:
            provider:       fos_userbundle
            login_path:     /admin/login
            use_forward:    false
            check_path:     /admin/login_check
            failure_path:   null
        logout:
            path:           /admin/logout
        anonymous:    true
    # -> end custom configuration

    # defaut login area for standard users
    main:
        pattern:      .*
        form_login:
            provider:       fos_userbundle
            login_path:     fos_user_security_login
            use_forward:    false
            check_path:     fos_user_security_check
            default_target_path: /
            failure_path:   null
        logout:       true
        anonymous:    true

这是我的config.yml ..

fos_oauth_server:
    db_driver: orm       # Driver availables: orm, mongodb, or propel
    client_class:        Sportimimi\userBundle\Entity\Client
    access_token_class:  Sportimimi\userBundle\Entity\AccessToken
    refresh_token_class: Sportimimi\userBundle\Entity\RefreshToken
    auth_code_class:     Sportimimi\userBundle\Entity\AuthCode   
    service:
        user_provider: fos_user.user_manager

0 个答案:

没有答案