0

I'm in the process of learning and experimenting with Express Gateway and some simple services ( or even just a small monolithic api that sits behind the gateway )

I have gone through Express Gateway 'Getting Started' examples and have read through documentation.

Right now I'm trying to grasp how a user of the system, client/customer, will be created.... The confusion lies in the area where the 'Getting Started' tutorials had me create a user WITHIN Express Gateway.

But coming from a monolithic RESTful API viewpoint... the system may have its own DB schema for what a User is. Client app calls an API endpoint for user creation, goes through its own process, makes the record, returns to the client a successful creation ( or not ). Then getting the user authorized ( JWT / OAuth / etc.. )

So using Express Gateway, do we need to create a user, then pass that ID down to a UserService to save in its own dB, linking this newly created id with the express gateway id ?

ndyr
  • 503
  • 4
  • 20

1 Answers1

0

That is correct; usually what you want to do when you are creating a new user is to make a call both your database/service and to Express Gateway as well with some of the details so they stay in sync.

If you do not really want to do that it's advised to use a thirty party service such as Auth0 to keep the identity users decoupled from the user details.

Does that explain/clarify?

Vincenzo
  • 1,549
  • 1
  • 9
  • 17
  • Ah, so Express Gateway always has to have these Identity Users created? If there was no Auth0 authentications/authorization, would this mean then that Express Gateway would need its own DB to hold these identity users? Since restarting Express Gateway would wipe out these user records. – ndyr Oct 10 '19 at 13:16
  • Correct; Express Gateway comes with a Redis integration so if you plug it with the correct connection, it will hold your data. – Vincenzo Oct 11 '19 at 14:02