I'm working on a REST API in Symfony2 (created with FosRestBundle).
Before oauth was enabled I could try the API methods in the sandbox provided by nelmio.
Example:
GET /api/products/{id}.json
However now that oauth is enabled in order to call an API method I have to add the oauth token as a query string.
Example:
GET /api/products/{id}.json?access_token=ZWRhNTE2MGUzZWE4ZTIzNDIxMGUxNjZkY2Yx...
These api calls work outside nelmio without any problems.
In order to activate support for oauth in nelmio I've added the following config in /app/config.yml
:
nelmio_api_doc:
sandbox:
authentication:
name: access_token
delivery: http
type: bearer
After that it asks for an api key
at the top of the screen, however if I set there the oauth token I still get an unauthorized response when trying to use the sandbox.
Any idea how to fix this?