Reputation: 136
Would like to get some opinion on designing a system with subscription model using microservice architecture.
We implemented an identity server which authenticates and authorizes users, and stores their subscription profile. (i.e. resources they can access like which magazine and issues)
on the resources service, the subscription profile will be used to filter their eligibility. example, if their subscription starts from Year 2018, then this will take effect and return only year 2018 data to the users via REST API.
Is this a standard/proper microservice architecture implementation? or any better ways to design this?
Upvotes: 1
Views: 2508
Reputation: 5264
I'd argue no, especially if you want to embrace the principles of microservices - you're storing authorization and application domain specific data in your Identity server. Your IDP should only be concerned with authentication concerns.
I'd suggest a separate service or set of services for managing and retrieving this additional information that is linked to user entities in your IDP via a correlating ID (e.g. subject ID, email address, account code etc). This service would own its own data and be consumed by anything which needs to know about subscriptions and the like.
Upvotes: 2