2017-10-02 13 views
0

제목에 언급했듯이 SecurityTokenRespone에 문제가 있습니다. 내가 생산 전화 CRM을 할 때SecurityTokenRespone is null

IServiceManagement<IOrganizationService> serviceManagement = ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri("https://SERVICE_URI")); 
AuthenticationCredentials authCreds = new AuthenticationCredentials(); 
authCreds.ClientCredentials.UserName.UserName = userName; 
authCreds.ClientCredentials.UserName.Password = password; 
AuthenticationCredentials tokenCreds = serviceManagement.Authenticate(authCreds); 
SecurityTokenResponse securityToken = tokenCredentials.SecurityTokenResponse; 

것은이 우리의 생산 CRM 구성 때문에 ADFS 테스트 CRM은 '아무튼인가 ... 난 SecurityTokenRespone을 얻을하지만 난 우리의 테스트 CRM SecurityTokenRespone에 전화를 걸 경우는 null입니다 티?

그렇다면 여하튼 (Google의 테스트 CRM은 인터넷에 노출 될 수없는 도메인에 있음) 무시할 수 있습니까?

감사합니다 :)

답변

1

내가 그 테스트 CRM에 당신이 ADFS없이 그냥 일반 AD 로그인을 사용하는 가정합니다. 그렇다면 여기에 보안 토큰이 없으므로 보안 토큰을 얻을 수 없습니다. 조직 서비스를 받으려면 다음과 같이하십시오.

ClientCredentials clientCreds = new ClientCredentials(); 
clientCreds.Windows.ClientCredential.UserName = "username"; 
clientCreds.Windows.ClientCredential.Password = "pass"; 
clientCreds.Windows.ClientCredential.Domain = "domain"; 
IServiceConfiguration<IOrganizationService> orgConfigInfo = ServiceConfigurationFactory.CreateConfiguration<IOrganizationService>(new Uri("http://yourcrmserver/CRO/XRMServices/2011/Organization.svc")); 
OrganizationServiceProxy orgserv = new OrganizationServiceProxy(orgConfigInfo, clientCreds); 
+0

그렇다면 테스트 CRM이 설치된 서버에는 ADFS가 없습니다. 우리는 Dynamcis CRM 365를 사용하므로'CrmServiceClient'를 사용하여 CRM에 연결합니다. 고마워 :) – Genato