VismaLietuva/simoona

CORS Error --- No 'Access-Control-Allow-Origin' header is present on the requested resource.

g0dEngineer opened this issue · 8 comments

After setup completed from binaries, after supplying testorg for orgname, no login fields are present due to CORS error.

How to resolve?

image

Locally CORS shouldn't cause any issues, since it should be set to AllowAnyOrigin = true (following CorsOriginsSettingKey is empty in default web.config).
Can you try if API webapp is running successfully for you by opening http://localhost:50321/swagger/ui/index?

Locally CORS shouldn't cause any issues, since it should be set to AllowAnyOrigin = true (following CorsOriginsSettingKey is empty in default web.config). Can you try if API webapp is running successfully for you by opening http://localhost:50321/swagger/ui/index?

Thanks for your guide.

Getting an error @Swagger url provided:

image

Also, not seeing CorsOriginsSettingKey nor AllowAnyOrigin = true in default web.config file. I will add this to the config and try again.

<httpProtocol>
  <customHeaders>
    <add name="Access-Control-Allow-Origin" value="*" />
    <add name="Access-Control-Allow-Headers" value="Content-Type" />
    <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
  </customHeaders>
</httpProtocol>

Added above web.config, but still no luck, same CORS error after restarting install.bat for Simoona

Also, not seeing CorsOriginsSettingKey nor AllowAnyOrigin = true in default web.config file. I will add this to the config and try again.

I was speaking about this web.config - https://github.com/VismaLietuva/simoona/blob/master/src/api/Shrooms.Presentation.Api/Web.config#L79

So first thing to solve is to make API working, i.e. Swagger UI should load successfully.
Did you check you have all the prerequisites installed (https://github.com/VismaLietuva/simoona/blob/master/LocalSetup.md). It's a common case IIS URL Rewrite extension is missing, since it needs to be installed separately.

I was speaking about this web.config - https://github.com/VismaLietuva/simoona/blob/master/src/api/Shrooms.Presentation.Api/Web.config#L79

So first thing to solve is to make API working, i.e. Swagger UI should load successfully. Did you check you have all the prerequisites installed (https://github.com/VismaLietuva/simoona/blob/master/LocalSetup.md). It's a common case IIS URL Rewrite extension is missing, since it needs to be installed separately.

All pre-requisites were installed, including IIS URL Rewrite extension.
Albeit thanks for guide. Not sure what the issue is

I had recently a similar issue. I resolved my issue by deleting in IIS both applications and application pool and then running build.bat again with a full setup.

I had recently a similar issue. I resolved my issue by deleting in IIS both applications and application pool and then running build.bat again with a full setup.

Thanks. I will try that and restart.

Closing as not active and no new details provided