下面正在做SSO密码修改部分,很多人都遇到一些同样的问题,简单代码如下:
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 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中可以正常工作,继续探索中。。。。
Error Code |
Meaning |
When Thrown |
Bubbled Behavior |
How To Overcome |
-2140993974 |
SSO is not configured |
Failure when SSO has not been setup via Central Administration |
Critical error logged in ULS with error code. |
If SSO is not configured then configure from Central Admin. |
-2140993973 |
SSO Wrong Version |
SSO config setting or master secret has changed and change has not reflected. |
Critical error logged in ULS with error code. |
Not applicable. Self healing error. |
-2140995575 |
Failed to connect to SQL Server |
Creation of the SSO database fails. |
Critical error logged in ULS with error code. |
Check SQL connectivity. |
-2140995576 |
SharePoint Central administration virtual root not found |
The SSO folder under 12\Template\Admin\SSO does not exist. This check performed while configuring master secret server. Either a call into Configuration.ConfigureSecretServer via OM or the UI page to configure SSO can throw this error. |
Error logged in ULS with error code. Or error returned to calling function |
Repair the product installation. |
-2140995588 |
Web application not running with windows authentication. |
When a custom webpart is placed on a page in a non-windows auth web app. |
Error logged in ULS with error code. Or error returned to calling function. |
Check authentication providers for the web application. If you have a requirement to have the web app behind FBA, then SSO cannot work. |
-2140995589 |
SQL Server not supported. |
If the SQL server specified to host the SSO db is not greater than or equal to SQL Server 2000 SP3. |
Error logged in ULS with error code. Or error returned to calling function. |
Check SQL Server patching and version numbers. |
-2147023143 |
Failure to connect to the Microsoft Single-SignOn Service. |
Failure to connect to the MS SingleSign On Service. Either when the service is not started or the service has a logon failure. |
Error logged in ULS with error code |
- |
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.