Authentication question about react web application behind EKS alb ingress

6/6/2019

I have a react web application running on a eks cluster. I have created a EKS alb ingress to authenticate users. I haven't figure out if I do so, how my react web application to know who is signed in. The ingress will forward some headers to the backend, not sure in my react web where to catch these headers? or I have to setup something on the web server? right now, I deploy the react web in development mode.

-- L.T.
aws-application-load-balancer
eks
kubernetes-ingress
reactjs

1 Answer

6/6/2019

Please take a look for this one example with nginx and "auth_request Module"

As per tutorial:

The auth_request module sits between the internet and your backend server that nginx passes requests onto, and any time a request comes in, it first forwards the request to a separate server to check whether the user is authenticated, and uses the HTTP response to decide whether to allow the request to continue to the backend

In addition you can can use open source project “Vouch” to authenticate users via a variety of backends.

Using appropriate nginx configuration with vouch your server can handle both authentication using "HTTP header" and redirecting connection from "authenticated users" to the backend server.

Hope this help

-- Hanx
Source: StackOverflow