2

I try to use FOSUserBundle and FOSOAuthServerBundle to secure my symfony2 Application. I followed documentation, created a client and so an. But when I call /oauth/v2/auth I get a Route not found error: No route found for "GET /oauth/v2/auth_login"

Can anyone help, what I have missed?

Thanks!

user3460622
  • 165
  • 1
  • 11

1 Answers1

1

Don't forget to do step 5 and add the routes to your config.yml file:

# app/config/routing.yml
fos_oauth_server_token:
    resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"

fos_oauth_server_authorize:
    resource: "@FOSOAuthServerBundle/Resources/config/routing/authorize.xml"

By accessing /oauth/v2/auth_login, you should get:

{"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"}

This is because you'll need to send a few parameters. Here is an example if you are using a grant type password. You'd have to provide the following parameters to your url:

  1. your_client_id
  2. your_client_secret
  3. a_user_username
  4. a_user_password

    http://yourWebsite.com/app_dev.php/oauth/v2/token?client_id=your_client_id&client_secret=your_client_secret&grant_type=password&username=a_user_username&password=a_user_password

Mick
  • 30,759
  • 16
  • 111
  • 130
  • 2
    I've done step 5 and included the routing. When I look in the symfony2 profiler I can't the any routes matching oauth/v2/auth:login – user3460622 May 06 '14 at 15:07