Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

11
Question: API Gateway Service + Auth Service Tight coupling when using JWTs
Post Body

I am designing a microservice architecture for a hobby project, mostly just for self-learning purposes. In my architecture, the API Gateway service verifies and decodes JWTs before sending requests to the proper upstream services. The Auth service has the primary data store for user names and passwords, and signs JWTs when a user logs in. My fear is that the API Gateway service and Auth service are too tightly coupled. In my design I attempt to decrease coupling be having the API Gateway verify the JWTs, so it doesn't need to reach out to the Auth service for every request. The coupling comes from the usage of public keys. Say the auth service automatically and periodically rotates its keys, and signs the JWTs with the new key id. Now the API Gateway needs some knowledge of the new public keys when they get rotated. Perhaps this can be done with a one time request - if a new key-id that the API Gateway hasn't seen before comes in the request, the API Gateway could make a request to the Auth service requesting the new public key. Does anyone have any comments on this design?

P.S. would anyone care to do a design review once I'm done with these design docs? I realize there is /r/codereview, but this seems like a better place for it.

THANKS!

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
42,211
Link Karma
2,070
Comment Karma
40,068
Profile updated: 1 week ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago