public Task<LoginInteractionResponse> ProcessClientLoginAsync(ValidatedAuthorizeRequest request)
        {
            // check idp restrictions
            var currentIdp = request.Subject.GetIdentityProvider();
            if (request.Client.IdentityProviderRestrictions != null && request.Client.IdentityProviderRestrictions.Any())
            {
                if (!request.Client.IdentityProviderRestrictions.Contains(currentIdp))
                {
                    var response = new LoginInteractionResponse
                    {
                        SignInMessage = _signIn
                    };

                    Logger.WarnFormat("User is logged in with idp: {0}, but idp not in client restriction list.", currentIdp); 
                    
                    return Task.FromResult(response);
                }
            }

            // check if idp is local and local logins are not allowed
            if (currentIdp == Constants.BuiltInIdentityProvider)
            {
                if (_options.AuthenticationOptions.EnableLocalLogin == false || 
                    request.Client.EnableLocalLogin == false)
                {
                    var response = new LoginInteractionResponse
                    {
                        SignInMessage = _signIn
                    };

                    Logger.Warn("User is logged in with local idp, but local logins not enabled.");
                    
                    return Task.FromResult(response);
                }
            }

            return Task.FromResult(new LoginInteractionResponse());
        }
        public Task<LoginInteractionResponse> ProcessClientLoginAsync(ValidatedAuthorizeRequest request)
        {
            // check idp restrictions
            var currentIdp = request.Subject.GetIdentityProvider();
            if (request.Client.IdentityProviderRestrictions != null && request.Client.IdentityProviderRestrictions.Any())
            {
                if (!request.Client.IdentityProviderRestrictions.Contains(currentIdp))
                {
                    var response = new LoginInteractionResponse
                    {
                        SignInMessage = _signIn
                    };

                    return Task.FromResult(response);
                }
            }

            return Task.FromResult(new LoginInteractionResponse());
        }