I try to write console app with crm service and I get this error:
Unable to connect to CRM: An error occurred when processing the security tokens in the message:You are using Ws-Tust authentication which has been deprecated and no longer supported in your environment. Please use oAuth2.0 authentication.
how I can to solve it?
Try this connection string:
Where Username is your CRM login and Password is your password accordingly. Url is the link to your crm instance.
AppId and RedirectUri should be yours Ids from AzureAD but I've took them at official documantation page Use connection strings in XRM tooling to connect to Dynamics 365 Customer Engagement (on-premises) and it worked for me :-).