I've been using Open Policy Agent for this scenario with great success. You can either use it in a AZ as a service setup or embed it into middle ware for a sort of "decision making" library.
Here's a blog post [0] about the challenges we faced when using OPA for application authorization.
[0] https://www.aserto.com/blog/the-challenges-of-using-opa-for-...