Pez
Pez

Reputation: 1299

HWIOauthBundle (0.3.*@dev) installed on Symfony 2.3.4, getting generic "No oauth code in the request." error

I hope I'm not missing anything obvious.

I've installed HWIOauthBundle (as well as FOSUserBundle) as shown here: https://gist.github.com/danvbe/4476697

I simply copied code from the files to my own...and did this twice, so I'm 99.9% sure I didn't miss anything. (edit: and changed namespaces where necessary)

Every time i try to hit the connect url (myapp.com/login/check-facebook) I get a "No oauth code in the request." error.

I'm not sure how to go about debugging this...there is virtually no documentation for HWIOAuthBundle, In my logs I only see the below:

[2013-09-25 19:07:00] request.INFO: Matched route "hwi_oauth_service_redirect" (parameters: "_controller": "HWI\Bundle\OAuthBundle\Controller\ConnectController::redirectToServiceAction", "service": "check-facebook", "_route": "hwi_oauth_service_redirect") [] [] [2013-09-25 19:07:00] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest". [] [] [2013-09-25 19:07:00] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". [] [] [2013-09-25 19:07:00] security.INFO: Authentication request failed: No oauth code in the request. [] []

Anyone have any thoughts that might be helpful? I'm new to Symfony2 but am trying to do this right...but my unfamiliarity with this framework has left me at a loss for how to solve this issue.

Upvotes: 1

Views: 1064

Answers (1)

Felix G.
Felix G.

Reputation: 6691

The check-login route is the route you will be redirected after you tried to connect to Facebook (or Twitter etc.). You have to call the route myapp.com/login/facebook, this should redirect to your Facebook account and ask for your confirmation, after that it will send you back to your app to myapp.com/login/check-facebook.

And do not forget to configure your Facebook app and store the neccessary OAuth keys into your configuration.

Upvotes: 1

Related Questions