Seems like a repeated question yet couldn't resolve it. I have angular 6 app that uses Msal to force users to login. After successful login, I am making a request to aad's token end point passing service principal credentials (application's app id and client secret) to get access token to access graph api as mentioned here. This is where I am getting CORS policy error.
When I disable chrome browser security, I am not getting any CORS error and able to get access token.
Why am I getting CORS error only when I try to get access token using service principal credentials and not on user's login using msal?
Do I need to have any script at browser end to make it work?
how do I achieve it without compromising security?
The login authority is : https://login.microsoftonline.com/{tenant id}/
The token endpoint for service principal is: https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/token