Developing an API gateway on Google Kubernetes Engine for ExpessJS / Passport authentication

5/30/2020

I have develope a web application with express js in backend and react in frontend deployed on GAE and now I'm migrating to a microservices architecture in GKE. At the moment, I'm thinking of 3 servies (frontend, backend logic and CRUDs, and authentication service), so the frontend user will try to connect to an API gateway (which will handle the authentication service) and return the token to the client and then for each client request it go throw the API gateway to verify the token and call the appropriate API.

So my issue in implementing the API gateway with the auth service, I have deployed the auth in a separte cluster and is implemented this way in the backend using Passport JS , Google Oauth startegy and JWT strategy : the client goes to backend.com/auth/google then selects the appropriate google account (and get a google ID) the he will be redirected to backend.com/callback which is a function implemented to create a JWT token using that google ID and return that to the frontend).

So what type of API gateway should I use with this type of auth service ? and how it will communicate in that scenario between the frontend and the microservices ?

Many thanks

-- xgeek95
express
google-cloud-platform
kubernetes
node.js
passport.js

0 Answers