Open AdriaFret opened 1 year ago
Could you please show your serverless-auto-swagger custom config in your Serverless file?
Yes for sure, thats how we tried to configure it but we couldn't figure it out a way to make it work:
Could you try making lambdaAuthorizer
the same object that you're using in your http events, i.e.
custom:
...
customAuthorizer:
type: COGNITO_USER_POOLS
authorizerId: !ImportValue authorizer
autoswagger:
...
lambdaAuthorizer: ${self:custom.customAuthorizer}
functions:
...
test:
...
events:
- http:
...
authorizer: ${self:custom.customAuthorizer}
This was my use-case when I added this feature. If this doesn't work, I honestly don't know a ton about authorizers, so I don't know if more complex scenarios are possible.
(also, careful with the indentation in my example – treat that as pseudo-code, as I simply typed it up in GitHub markdown code)
I have tried the same. But after running sls offline start
, it is generated swagger.js
file with "securityDefinitions": {},
and hence my custom authorizer is not working in the swagger UI
Hello! We are having some troubles trying to implement the lambdaAuthorizer in the swagger endpoints. We have a microservices architechture, our authorizer is in a separated microservice and we can use this authorizer ( via output variable) in our lambdas. Here is a code snipet of how we use this authorizer in our lambdas:
The idea that we had is to reuse this authorizer for the lambdaAuthorizer section but we can't figure it out why it ain't working (maybe we are missunderstanding or doing something wrong).
Thank you for your time in advance.