Register IIdentityServerInteractionService in Identity Server 4 for OpenID Connect

I am trying to follow this guide Adding user authentication using OpenID Connect from Identity Server 4 documents, but I get the following error when I start the mvc client:

InvalidOperationException: Cannot resolve service for type "IdentityServer4.Services.IIdentityServerInteractionService" while trying to activate "IdentityServer4.Quickstart.UI.HomeController".

How do I register the Identity Server Interaction Service ? This sounds like a problem with DI.

+5
source share
1 answer

You get this error if there is no implementation of the IIdentityServerInteractionService interface in the dependency injection container. In the QuickContart example HomeController, the implementation of the IIdentityServerInteractionService in the constructor:

 public HomeController(IIdentityServerInteractionService interaction) { _interaction = interaction; } 

You must add services.AddIdentityServer(); to the ConfigureServices method in your startup class. IdentityServer will implement the implementation of IIdentityServerInteractionService , named DefaultIdentityServerInteractionService .

+8
source

Source: https://habr.com/ru/post/1262649/


All Articles