我正在研究phantomjs作为我最新项目中UI自动化的可能解决方案,但我似乎无法让Windows身份验证正常工作.我已经尝试设置page.settings.userName和page.settings.password,但低于总的片段得到一个401和底层堆栈没有努力解决这个问题.我的搜索失败了,所以我来到社区寻求帮助.
var page = require('webpage').create();
page.onResourceReceived = function(response) {
phantom.exit(response.status);
};
page.open('http://bing.com');
Run Code Online (Sandbox Code Playgroud) 我有一个非常简单的客户端 - 服务器应用程序,我用它来分隔两个不能在同一个进程中共存的组件.在开发它们时(服务器是一个exe,客户端是一个库),我所有的单元测试都像猪粪一样高兴.当我继续在其他地方重新使用库时,我得到以下异常:
System.Runtime.Remoting.RemotingException: An error occurred while processing the request on the server: System.Security.SecurityException: Cannot open an anonymous level security token.
at System.Security.Principal.WindowsIdentity.GetCurrentInternal(TokenAccessLevels desiredAccess, Boolean threadOnly)
at System.Security.Principal.WindowsIdentity.GetCurrent()
at System.Runtime.Remoting.Channels.Ipc.IpcServerTransportSink.ServiceRequest(Object state)
The Zone of the assembly that failed was:
MyComputer.
Run Code Online (Sandbox Code Playgroud)
我已经在代码中设置了双方的远程处理,而不是在此阶段为了简单而配置文件.它们实际上完全相同:
BinaryClientFormatterSinkProvider client = new BinaryClientFormatterSinkProvider();
BinaryServerFormatterSinkProvider server = new BinaryServerFormatterSinkProvider();
server.TypeFilterLevel = TypeFilterLevel.Full;
Hashtable config = new Hashtable();
config["name"] = "SomeName";
config["portName"] = "SomePortName";
config["typeFilterLevel"] = "Full";
config["impersonate"] = "true";
config["tokenImpersonationLevel"] = "Impersonation";
config["useDefaultCredentials"] = "True";
config["secure"] = …Run Code Online (Sandbox Code Playgroud)