ismetacar / ertis-auth

Generic token generator and validator service like auth
MIT License
29 stars 2 forks source link

CORS settings #6

Closed Rakkoc closed 3 years ago

Rakkoc commented 3 years ago

Hello,

Does Ertis-auth have a CORS setting? I could not use it with direct access from browser via vuejs or angular. It throw CORS error.

ismetacar commented 3 years ago

Hi @Rakkoc,

While developing the Ertis Auth project, it was developed in accordance with microservice standards, http and rest standards. It can be positioned as a microservice in any system.

But CORS is cross-cutting concern. It should be handled on the edge. eg. Gateway.

But If we don't have any chance to change this setup, baking CORS setting into microservices might be acceptable. If there is a development about CORS, it will be a process that will contradict the generic approach of the project.

However, I can recommend that, Ertis Auth is developed with the Sanic framework and there are extensions in the Sanic ecosystem about CORS. You can quickly solve this problem with extensions. eg. Sanic Cors

You can find solution in here. https://pypi.org/project/Sanic-Cors/