下面正在做SSO密码修改部分,很多人都遇到一些同样的问题,简单代码如下:
WindowsImpersonationContext wic
=
null
;
try
{
wic = CreateIdentity("administrator", "iswind", "iswind").Impersonate(); //提升权限
string [] args = new string[2];
//userName
args[0] = "username";
//pwd
args[1] = "12345678";
//应用名
string AppName = "SSOApp";
string domainAndName = "iswind\\username";
Credentials.SetUserCredentials(AppName,domainAndName,args);
}
catch (SingleSignonException ex)
{
throw ex;
}
finally
{
wic.Undo();
}
错误提示信息:
服务器应用程序不可用!
try
{
wic = CreateIdentity("administrator", "iswind", "iswind").Impersonate(); //提升权限
string [] args = new string[2];
//userName
args[0] = "username";
//pwd
args[1] = "12345678";
//应用名
string AppName = "SSOApp";
string domainAndName = "iswind\\username";
Credentials.SetUserCredentials(AppName,domainAndName,args);
}
catch (SingleSignonException ex)
{
throw ex;
}
finally
{
wic.Undo();
}
The system can add the credentials successfully, but it throws an error when the other application
is
trying to read it. The error thrown
is
“Using A call into SPS Single Sign
-
on failed. The error code returned was
'
-2140995583
'
.”
The error found in Event Viewer: “The Microsoft Single Sign - on (SSOSrv) service failed to retrieve credentials for user GICDEV\ncs3, enterprise application definition 8a9b6ddd - 3542 - 4774 - 98cc - aa08aeabebea. The error returned was 0x80630001 .”
The error found in Event Viewer: “The Microsoft Single Sign - on (SSOSrv) service failed to retrieve credentials for user GICDEV\ncs3, enterprise application definition 8a9b6ddd - 3542 - 4774 - 98cc - aa08aeabebea. The error returned was 0x80630001 .”
恩,还是权限问题,-2140995583估计是这个问题代号,目前还没有搜索到呢,不过普遍反映如果如上代码在
WinForm或者Console中可以正常工作,继续探索中。。。。
The above information is indicative of the errors that you may encounter while working with Single SignOn on MOSS 2007. This is only for troubleshooting purposes.