I have the spring boot application running on the domain A.It purpose is to expose some REST endpoints.
Also, I have angular 8 application. It could be deployed on the same domain A, or in other domain B. The spring boot app is aware of on which domain is angular app deployed.
I need to configure Spring security,so it will accept requests on particular endpoints ONLY from the angular app. But also, some of the endpoints need to be role-aware
For example:
- /api/v1/resources/** - should be from angular app only
- /api/v1/resources/admin/** - should be only from angular app AND user should have admin role
- /api/v1/payments/** - this can accept requests not only from angular app (merchant callbacks for example)
I would highly appreciate some pieces of advice on the best approach for this