Access to XMLHttpRequest at
‘https://apicredit2fa.devserver.co.in/api/adminaccount/signin’ from
origin ‘http://localhost:3000’ has been blocked by CORS policy
Response to preflight request doesn’t pass access control check: The ‘Access-Control-Allow-Origin’ header contains multiple values ‘*, *’, but only one is allowed.
I cofigured the default cores and using middleware app.UseCors();
as well
I tried with fixed cores but getting * and core name . multiple error remains
3
Answers
issue resolved. problem was nginx proxy server that was adding extra header value.
Hello you can try this
and below consume this policy It works
The error
indicates there’re mutipule
'Access-Control-Allow-Origin'
in your response headersand if you configured
AllowAnyOrigin()
when you regist cros,it would add'Access-Control-Allow-Origin' :"*"
to your response header,try remove
AllowAnyOrigin()
and observe if there’re any other error or check if you added the header anwhere else againIf you still have problem,please show us a minimal example that could reproduce the error