我在工作中遇到问题,因为在与其他域通信时对域信任使用选择性身份验证时,使用WCF进行SSO的应用程序失败.这是在服务器2k8R2机器上,两个域的完整2k8R2功能级别(这是一个测试系统,因为我们有一个客户想要部署这种类型的东西).
基本上,我们有两个域,称为A和B.当我们在域之间执行完全双向EXTERNAL(非林)信任时,应用程序正常工作(当然将用户放在其他域上的适当组中) .然后我们将关系从"域范围"身份验证转换为"选择性身份验证".根据我们读过的一些文档,我们需要直接将用户添加到AD中的每台计算机条目,并为其授予"允许进行身份验证"权限.
它没用.
此外,我们在某处看到ELSE暗示我们必须在DC上给予他们相同的权限.这样就完成了.再一次,失败.
应用程序抛出的异常如下(我将其转储到文件中)
A call to SSPI failed, see inner exception. Stacktrace:
Server stack trace:
at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)
at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] …Run Code Online (Sandbox Code Playgroud) 这有点模糊不清:我需要获取用户/组的用户@域形式,但我不想要域\用户表单.我遇到一个问题,一个长的Windows 2003+名称,其中两个是不同的,因为域\用户长度限制,因为新表单没有限制.
我在C#下,虽然我可以做以下事情:
string GetUserName(SecurityIdentifier SID)
{
NTAccount account = SID.Translate(typeof(NTAccount));
string [] splits = string.Split("\\", account.Value);
return splits[1] + @"@" + splits[0];
}
Run Code Online (Sandbox Code Playgroud)
这并不总是正确的,正如我在我的介绍中所说,用户名@ domain与用户名的旧Windows NT形式不一样.如果您不相信我,请进入2k3 +盒子上的AD用户和计算机,看看旧NT用户名与新用户名的区别.
那么我如何保证从SID获得正确的用户名@ domain?除此之外,我还需要这种类型的东西为本地用户/组工作.
我不知道为什么这是错误的,但我只是想在endl中添加"akin",以便我可以将ostringstream中的内容添加到调试器中.我有以下内容:
class debug_stream_info
{
public:
debug_stream_info(int errorLine, char *errorFile, int level)
:m_errorLine(errorLine), m_errorFile(errorFile), m_logLevel(level)
{
}
friend std::basic_ostringstream<char>& operator<<(std::basic_ostringstream<char>& os, debug_stream_info& debug_info);
private:
int m_errorLine;
std::string m_errorFile;
int m_logLevel;
};
std::basic_ostringstream<char>& operator<<(std::basic_ostringstream<char>& os, debug_stream_info& debug_info)
{
// Write the stream's contents to cpu_debug
// Deleted custom logging function. No errors here though
// Clear the stream for re-use.
os.str("");
os.seekp(0);
return os;
}
int main(int argc, char** argv)
{
std::ostringstream myout;
myout << "hey there" << " and some more …Run Code Online (Sandbox Code Playgroud) 我在c ++ 11中写了这行前正则表达式:
regex a("(\\w\\d)+(\\W)?(*)(\\W)?(\\w\\d)+");
Run Code Online (Sandbox Code Playgroud)
我想找到像A*B这样的短语(A或B可以是数字),空格是可选的
但在这条线上它会豁免!惠特这行代码有什么不对?