我在我的CRM實例上配置了基於聲明的身份驗證。我正在使用自定義STS(可用示例here)現在我想從某個測試應用程序訪問Web服務。 有沒有人有這樣的例子? 我嘗試使用相同的代碼進行連接以防止Windows身份驗證。但是,當然,不成功。 我發現了一個錯誤:如何使用SDK連接到CRM(基於聲明的身份驗證和自定義STS)
{"The authentication endpoint Kerberos was not found on the configured Secure Token Service!"}
這是連接代碼(AD身份驗證類型):
OrganizationServiceProxy orgserv;
ClientCredentials clientCreds = new ClientCredentials();
ClientCredentials devCreds = new ClientCredentials();
clientCreds.Windows.ClientCredential.UserName = "user";
clientCreds.Windows.ClientCredential.Password = "[email protected]$$w0rd";
clientCreds.Windows.ClientCredential.Domain = "myDomain";
IServiceConfiguration<IOrganizationService> orgConfigInfo =
ServiceConfigurationFactory.CreateConfiguration<IOrganizationService>(new Uri("https://myCRMServer/myOrg/XRMServices/2011/Organization.svc"));
using (orgserv = new OrganizationServiceProxy(orgConfigInfo, clientCreds))
{
orgserv.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
orgserv.EnableProxyTypes();
connection = orgserv;
}
我發現的地方,基於要求的認證就足以只發送UPN(用戶主要名稱)。但同樣的錯誤發生。我也嘗試使用用戶名/密碼組合,但不成功。
AuthenticationCredentials authCredentials = new AuthenticationCredentials();
...
authCredentials.UserPrincipalName = "user";
...在此之後
錯誤是:The authentication endpoint Username was not found on the configured Secure Token Service!
我在這裏得到一個錯誤:{嘗試了太多的自動重定向} ... – lazarus 2012-12-18 14:43:38