AspNetCore MVC-ControllerBase.Challenge问题

时间:2019-07-04 14:15:49

标签: c# asp.net-core asp.net-core-2.0 asp.net-core-mvc-2.0 .net-4.6.1

尝试在我的mvc项目中按以下方式使用Challenge(AuthenticationProperties, String[])

// Select the node that will be observed for mutations
var targetNode = document.getElementById('some-id');

// Options for the observer (which mutations to observe)
var config = { attributes: true, childList: true, subtree: true };

// Callback function to execute when mutations are observed
var callback = function(mutationsList, observer) {
    for(var mutation of mutationsList) {
        if (mutation.type == 'childList') {
            console.log('A child node has been added or removed.');
        }
        else if (mutation.type == 'attributes') {
            console.log('The ' + mutation.attributeName + ' attribute was modified.');
        }
    }
};

// Create an observer instance linked to the callback function
var observer = new MutationObserver(callback);

// Start observing the target node for configured mutations
observer.observe(targetNode, config);

// Later, you can stop observing
observer.disconnect();

但是出现以下错误

  

无法从Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties转换为字符串

我在这里做错什么了吗?

已更新

enter image description here

1 个答案:

答案 0 :(得分:1)

发现了问题

它是对AuthenticationProperties

的引用

这来自Microsoft.AspNetCore.AuthenticationMicrosoft.AspNetCore.Http.Authentication

它指向引起问题的Microsoft.AspNetCore.Http.Authentication