correct flow of authentication in flask api and angular frontend

Ducci Alberto Duccio 1 Reputation point
2021-05-13T07:34:19.657+00:00

Hello,
i have an angular SPA as a frontend of an API written with flask. I want to protect my API with login with microsoft accounts of my organization.
What is the best way to do that?
I tried to authenticate in angular and then send the authentication token to the API but i don't know if it is safe. In addition i need role based authorization (set up in azure application) but i found that the information is only in the id_token and not in the authentication token. I read in the documentation that authentication with id_token is to be avoided because is not secure. How can i do?
Thanks for the reply,
Alberto

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
711 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,289 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,369 questions
{count} votes