Using Microsoft OAuth Identity provider with IIS Express

Shouldn’t be any problem right? Facebook apps allows you to specify localhost for the callback/redirect url. Sweet! But microsoft doesn’t! So this is what I did.

I created a new application and specified as redirect domain.

I added a DNS record to C:\windows\system32\drivers\etc\hosts that routes to

I changed the site binding in %Documents%\IISExpress\config\applicationHost.config :

<site name="<site name>" id="24">
  <application path="/" applicationPool="Clr4IntegratedAppPool">
    <virtualDirectory path="/" physicalPath="<your-path>" />
    <binding protocol="http" bindingInformation="*" />

I changed the “Default Web Site” binding to port 8080 (or whatever) for IIS.

I turned off SQL Reporting Services because the agent used port 80. Use netsh to list port usage if you run into other problems.

netsh  http show urlacl | Select-String :80
Finally in my mvc project I changed the properties for the project to
  • Use Local IIS Web server
  • Check Use IIS Express, Project Url: http://localhost
  • Check override application root URL:
  • Set Start URL to:
Voilá, press F5 and IIS Express will fire up on with a working Microsoft OAuth Identity provider.
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *