Hi,
I follow the instructions from https://github.com/box/samples/tree/master/box-node-cognito-lambdas-sample as a proof of concept to integrate cognito/box/lambda.
while the instructions are pretty clear and easy to follow (found some gotchas documented here : https://github.com/box/samples/issues/15) I am struggling with a CORS issue.
I am using the angular2 sample application, here is flow:
1. creating user from the app --> creates user in cognito + box
2. when loggin in the app with the user, the app is calling lambda to get a token from box; when I debug the app through chrome console, I can see the token received from box to the lambda, but on the app I received a cors issue:
Failed to load https://: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
I enabled cors on the API gateway and redeploy the API
I added http://localhost:4200 in the CORS section of my box app
still I am getting error.
cloud watch is ok and as said, I can see the token from the console - when using a curl command (curl https://api.box.com/2.0/folders/0 -H "Authorization: Bearer )with the token, it works.
I am out of idea for now and still unclear for me, where the issue is coming from (most probably on AWS side but looks good to me)
Thanks,
Fred