Search code examples
.netsql-serverangularwindows-servergmsa

Getting CORS denied GMSA for MSSQL in appconfig.json of Angular + .Net project


We have hosted a few Angular and .Net Services. In the same server, we have MSSQl configured. When all the service's app pools in IIS, MSSQL Services etc were assigned to the my id, appication was giving CORS failures and I disabled webDAV. After that we didn't face any such issues.

Later on we configured the same app with GMSA id, and the webDAV is still disabled. Now the CORS issue is occurring again. The .Net API calls through Swagger are working, the issue is only when I try to login through Angular.

Is there any issue with the connection string, below are a few types I tried.

  1. "Connection": "server=MyServer;database="MyDB";user id='MyDomain\m-MyGMSAID$'; Trust Server Certificate=True;Persist Security Info=True; Integrated Security=SSPI;
  2. "Connection": "server=MyServer;database="MyDB";user id='MyDomain\m-MyGMSAID'; Trust Server Certificate=True;Persist Security Info=True; Integrated Security=SSPI;

How to overcome CORS where as no other explicit CORS policies have been set, on AWS, App Codes or IIS.


Solution

  • This worked for me, and the services are running without any issues almost a month now. "Connection": "server=MyServer;database=MyDB;Trust Server Certificate=True;Persist Security Info=True; Integrated Security=SSPI;"