Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Dynamics CRM online MFA with on-premise ADFS Authentication

$
0
0

I am facing issue with connecting Dynamics CRM online instance which has additional security enabled with MFA & ADFS on-premise . Office 365 is setup with Single-Sign-On (SSO) . When login from web we are able to login But programmatically using Organization Service we are not able to connect . following errors are encountered : 

ID3242: The security token could not be authenticated or authorized.

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
OrganizationServiceProxy service = null;
string ServerUrl = "CRM URL";
ClientCredentials creds = new ClientCredentials();
creds.UserName.UserName = username;
creds.UserName.Password = password;
               
service = new OrganizationServiceProxy(new Uri(ServerUrl), null, creds, null);
service.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
service.Timeout = new TimeSpan(23, 59, 59);
WhoAmIResponse whoAmIResponse = (WhoAmIResponse)service.Execute(new WhoAmIRequest());

Password , we have created APP password from account security page. 


Viewing all articles
Browse latest Browse all 82002

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>