Closed taenaive closed 2 years ago
Hi @taenaive!
The only work we've done with AWS Cognito is in the cloudformation.yaml at https://github.com/Senzing/aws-cloudformation-ecs-poc-simple.
We aren't experts in integrating with various platforms (Kubernetes, Openshift, Swarm, AWS) with various products (Npm, Django, jetty, etc). However, to try to help you out, 2 things:
-- Michael Dockter
@taenaive currently there is no support in the webapp to screen api calls for 401/403 responses and redirect on event. The feature will have to be added to the codebase. Typically we have the webapp connect to the api server over a private subnet/addr instead of hitting a publicly accessible path. I think it's a reasonable request to add 401/403 header intercepts/redirects functionality though. I'm gonna surface your request at our standup and see about adding it. (alternatively you could clone/fork the webapp and add global http intercepts yourself)
For connecting to an HTTPS api server, I think you've got the right idea but I'll need to spin up the same configuration to test against to see what's going on there. I'm thinking there's some cookie/session/header type thing going on(guessing from the UNABLE_TO_VERIFY_LEAF_SIGNATURE
part). you might try setting secure: false
on that redirect(that flag tells webpack dev srvr to validate ssl certs) just to see.
We are going to add a cloud formation that stands up the API server with the SSL Client authentication using SSL Certs.
Describe the bug Cognito How to To Reproduce Steps to reproduce the behavior:
Go to '/proxy.conf.json'
Change the Json to ': "/api/*": { "target": "https://senzing-....-amazonaws.com/api/", "secure": true, "logLevel": "debug", "pathRewrite": { "^/api": "" } },'
npm start
See an error
Expected behavior
should prompt the AWS Cognito login and the API server call should work.
Screenshots
[HPM] Rewriting path from "/api/attribute-types" to "/attribute-types" [1] [HPM] GET /api/attribute-types ~> https://senzing-....amazonaws.com/api/ [1] [HPM] Error occurred while trying to proxy request /attribute-types from localhost:4200 to https://senzing-....amazonaws.com/api/ (UNABLE_TO_VERIFY_LEAF_SIGNATURE) (https://nodejs.org/api/errors.html#errors_common_system_errors)
Desktop (please complete the following information):
Additional context I would like to know how to configure my locally running HTTP entity-search-web-app to connect to HTTPS api-server. Also, get an authentication log-in screen of Cognito.