Ask Your Question
2

Why do CORS errors occur when using Windows Auth on IIS with .Net 6 API, while Kestrel functions properly?

asked 2023-07-16 01:30:24 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-07-16 01:32:01 +0000

lakamha gravatar image

CORS errors occur when the client-side code running in the web browser requests data from a domain that is different from the domain of the API server. This is a security feature implemented by web browsers to prevent malicious websites from accessing user data on other websites.

When using Windows Auth on IIS with .Net 6 API, the API server may not correctly handle the CORS headers in the response, resulting in the client-side code being blocked from accessing the data. Kestrel, on the other hand, functions properly because it does not have the same level of security restrictions as IIS.

To resolve this issue in IIS, you may need to configure the API server to explicitly allow cross-origin requests from the client-side code. This can be done by adding the appropriate CORS headers to the response.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-16 01:30:24 +0000

Seen: 13 times

Last updated: Jul 16 '23