loopback-connector-swagger
loopback-connector-swagger copied to clipboard
It only works if I send the token in the query string
Bug or feature request
- [x] Bug
- [ ] Feature request
Description of feature (or steps to reproduce if bug)
- I declare a Swagger datasource in datasources.json. (it's another loopback app)
"SwaggerDS": {
"name": "SwaggerDS",
"connector": "swagger",
"spec": "https://myapi.domain.com/explorer/swagger.json",
"security": {
"type": "oauth2",
"name": "Authorization",
"accessToken": "bj4iI9q9uv9p5n0JVk1AUDOzFN1RZiOHj5JixJIK2DmLlwy1FEO9LLNe4957mYlX"
}
}
- I set a listener for the
connectedevent in the boot folder - The datasource connects
- I create a model, which contains every method of every model in the referenced loopback app
- I try to execute any method and it returns 404 error. (except for the
User_loginmethod) - If I define the connector as:
"SwaggerDS": {
"name": "SwaggerDS",
"connector": "swagger",
"spec": "https://myapi.domain.com/explorer/swagger.json",
"security": {
"type": "oauth2",
"name": "access_token",
"accessToken": "bj4iI9q9uv9p5n0JVk1AUDOzFN1RZiOHj5JixJIK2DmLlwy1FEO9LLNe4957mYlX",
"in" : "body"
}
}
Everything works.
Link to sample repo to reproduce issue (if bug)
N/A
Expected result
It should work either sending the token in the query string or in the header
Actual result (if bug)
It only works when sending the token in the query string
Additional information (Node.js version, LoopBack version, etc)
- node v8.11.3
- loopback v3.22
- loopback-connector-swagger: 3.2.0
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.