Try our conversational search powered by Generative AI!

OpenID connect



I am trying to integrate an episerver site with openID connect (against ID porten). Has anyone ever done this and can give me som advice? I have tried to follow this guide, but couldn’t make it work. The solution is Episerver 10 WebForms.

Oct 10, 2018 13:31


MVC or WebForms shouldn't matter in this case since Owin is running on top of ASP.NET.

What part of the guide did you struggle with? You should basically just need the two first code blocks, the rest should be configuration in ID porten. You also need to do the prerequisites here (link from the guide you posted).

Oct 10, 2018 15:42


I think I have done all the prerequisites and configurations. 

  • disabled role and membership provider
  • set authentication to none
  • Installed the packages
  • Set addClaims to true
  • configured the startup class according to the info I got from id porten

At some point, ID porten should hit. I thought that it would hit when I go to the url I provided in UrlLogin (/login)? Or do I have to manually redirect somewhere? Do the page /login need to exist? The way I configured it; if I go to /episerver, it complains about some unsufficient rights. If I go to /login, I get 404.

From what I can see, the Startup.cs never runs.

Oct 10, 2018 18:16

Hi Torunn

Does your startup look a bit like this:

[assembly: OwinStartup(typeof(YourNamespace.Startup))]

namespace YourNamespace
    public class Startup

If its never being excecuted then I am wondering if the OwinStartup attribute is missing?

Oct 10, 2018 21:37

Hi Torunn.

Next to the great answers from the other folks on this thread, it is worth as well verifying that your Startup indeed is executed. We have multiple times seen a correctly annottated Startup class not starting, which were caused by the optimizeCompilations="true" being set. If we set it to false for just one startup, it seemed to pick it up on any concurrent startups. 

I personally spent days on figuring this out! It later got documented by Episerver:

We always verify if Startup is executed by throwing an Exception inside of it, since your debugger most likely wont be attached early enough.

/Casper Aagaard Rasmussen

Oct 10, 2018 22:17

Make sure you have installed Microsoft.Owin.Host.SystemWeb. Otherwise your starup class won't be executed.

Oct 10, 2018 23:11

Hi Torunn, if you still have issues with OpenID Connect and Episerver, please have a look at my blog post that I did a while ago (the demo uses Alloy site) but we've implemented real customer cases with OpenID Connect using different Identity Providers.

Oct 13, 2018 21:16

Thank you for all the great answers! The issue was the  optimizeCompilations="true" in web.config. When I set this to false, the startup class ran. I wouldn't have figured this out myself. Thanks again!

Oct 15, 2018 9:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.