0

In my web application hosted on IIS server (.Net web API & Angular 7), I am using SAML authentification and I have a problem when I try to log in the website for the first time, it shows me the error bellow:

enter image description here

If I press Ctrl+F5 or I referesh it works perfectly.

PS: I added all configurations needed of headers in my web.config like this :

    <customHeaders>
            <remove name="X-Powered-By" />
            <add name="Access-Control-Allow-Origin" value="*"/>
            <add name="Access-Control-Allow-Credentials" value="true" />
            <add name="Access-Control-Allow-Headers" value="*" />
            <add name="Access-Control-Allow-Methods" value="GET, POST, DELETE, PUT, OPTIONS" />
   </customHeaders>

PS2: In my local environement I don't have this issue.

Thanks in advance for your help/advice.

1 Answer 1

1

You can try to configuring iis CORS module according to the content in this link:

https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module.

If it still does not work, then open your IIS manager and select the website -> Bindings, change the port to your custom port, for example: 8090.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi @samwu, the first solution dosen't work for me, and the second one I can't try it (I have "https" so the default port is 443 can't change it).
Then you can try to see if there are related error messages in the Event viewer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.