I have an external app that communicate with Crm through C# code. In order to do this, I have to authenticate this way:
IServiceManagement<IOrganizationService> orgServiceManagement = ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri("mycrm.crm.dynamics.com/.../Organization.svc")); AuthenticationCredentials authCredentials = new AuthenticationCredentials(); authCredentials.ClientCredentials.UserName.UserName = "myuser@myCrm.onmicrosoft.com"; authCredentials.ClientCredentials.UserName.Password = "mypassword"; AuthenticationCredentials tokenCredentials = orgServiceManagement.Authenticate(authCredentials);
There are two things I hate from this method. First, everyone within my organization who have access to the code can see my password. Secondly, my password is set to expire every 90 days and this occasion problems. Is there a way to log with Crm not using a certain user and with a method that will not require me to set the password to never expire?
Thanks for your help