title: Using Cognito Authentication with Elastic Load Balancer
body: <p>I have a ReactJS front end website which uses AWS Cognito for authentication, this is working fine, I can sign in, up, out, etc.  My back end is a set of Java web services running in Docker containers in AWS Fargate all behind an Elastic Load Balancer.</p>
  
  <p>I noticed that in the ELB, you can add Authentication to the listeners which will check the HTTP header for the jwt token and authenticate it before forwarding to the relevant micro service.  I've come a cross an issue where when I set the 'Authenticate...' rule, it comes back with an error that I need to add a client secret.  I can't add a client secret to my Cognito setup because I'm accessing it from ReactJS and apparently Javascript doesn't work with Cognito with Client Secret added.</p>
  
  <p>So if I can't use this method, I need some way of authenticating HTTPS requests when they get to my Java microservices.  From my Java service, it feels like I need to somehow access AWS Cognito to check the user session but that feels wrong.</p>
  
  <p>Any ideas how this should work?</p>
  
  <p>Thanks</p>