This project has moved and is read-only. For the latest updates, please go here.

External Idp using Cookie Middleware in IdentityServer3

Aug 3 at 9:57 AM
Hi All,
I'm using an internal Identity Store. In order to use it as an External Idp, I'm using the Cookie Middleware and when I run the website the following error is showed in the logger: no providers registered for client Following the Code in Startup.cs
using AuthorizationCFlow.Service;
using IdentityServer3.Core.Configuration;
using IdentityServer3.Core.Models;
using IdentityServer3.Core.Services;
using Microsoft.Owin.Security.Cookies;
using Owin;
using Serilog;
//using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Web;

namespace AuthorizationCFlow
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {

            var factory = new IdentityServerServiceFactory();
           factory.UseInMemoryClients(Shared.ConfigurationIdentity.GetClients())
            .UseInMemoryUsers(Shared.ConfigurationIdentity.GetUsers())
            .UseInMemoryScopes(StandardScopes.AllAlwaysInclude);

            app.Map("/identity", idsrvApp =>
            {
                idsrvApp.UseIdentityServer(new IdentityServerOptions
                {
                    IssuerUri = Shared.Constants.AuthorityIdentityServer,
                    SiteName = "Embedded IdentityServer",
                    SigningCertificate = LoadCertificate(),

                    Factory = factory,
                    AuthenticationOptions = new AuthenticationOptions
                    {
                        EnableLocalLogin = false,
                        IdentityProviders = ConfigureIdentityProviders
                    },

                });
            });
        }

        public static void ConfigureIdentityProviders(IAppBuilder app, string signInAsType)
        {
            var cookie = new CookieAuthenticationOptions
            {
                AuthenticationType = signInAsType,
                //Entry Point for my custom Idp 
                LoginPath = new Microsoft.Owin.PathString("/Account/Login"),
                AuthenticationMode = AuthenticationMode.Passive,
                CookieName = "CookiesIdp",
            };
            app.UseCookieAuthentication(cookie);
        }
        X509Certificate2 LoadCertificate()
        {
            return new X509Certificate2(
            string.Format(@"{0}\Certificate\idsrv3test.pfx", AppDomain.CurrentDomain.BaseDirectory), "idsrv3test");
        }
    }
}
Anyone has some suggestion for it ? Thank you