Try our conversational search powered by Generative AI!

OpenID connect

Vote:
 

Hi!

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 https://www.johanbostrom.se/blog/setting-up-episerver-to-use-openid-connect-with-identityserver, but couldn’t make it work. The solution is Episerver 10 WebForms.

#197681
Oct 10, 2018 13:31
Vote:
 

Hi,

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 https://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/9/Security/integrate-azure-ad-using-openid-connect/ (link from the guide you posted).

#197685
Oct 10, 2018 15:42
Vote:
 

Hi!

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.

#197698
Oct 10, 2018 18:16
Vote:
 

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?

#197709
Oct 10, 2018 21:37
Vote:
 

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:

https://world.episerver.com/documentation/upgrading/Episerver-CMS/75/EPiServer-and-OWIN/

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

#197710
Oct 10, 2018 22:17
Vote:
 

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

#197711
Oct 10, 2018 23:11
Vote:
 

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.

#197797
Oct 13, 2018 21:16
Vote:
 

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!

#197817
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.