“Cannot connect to Microsoft Dynamics CRM server because we cannot authenticate your credentials” error while setting up outlook client through ifd
Setting up Outlook client to work against a new Dynamics CRM 2011 IFD setup, I came across the following error:
Obviously my credentials were right and I had the proper certificates already installed. Everything worked fine through IE.
So, I turned on tracing by using the out of the box Diagnostics tool:
Tried again so I got the complete trace at:
C:\Users\<user>\AppData\Local\Microsoft\MSCRM\Traces
When opened the trace file I realized the true error:
…..
>Crm Exception: Message: Credentials required, ErrorCode: -2147220988
[2012-04-15 08:55:56.375] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread: 11 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Info | MiniDump.CreateDumpInternal
at MiniDump.CreateDumpInternal(MiniDumpReasons reason, Exception exception)
at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException, Boolean enableTrace)
at ClaimsBasedAuthProvider`1.AuthenticateClaims()
at ClaimsBasedAuthProvider`1.SignIn()
at ClientAuthProvidersFactory`1.SignIn(Uri endPoint, Credential credentials, AuthUIMode uiMode, IClientOrganizationContext context, Form parentWindow, Boolean retryOnError)
at DeploymentInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow, Credential credentials)
at DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
at DeploymentsInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow)
at ServerForm.LoadOrganizations(Boolean forceUI)
at ServerForm.<InitializeBackgroundWorkers>b__0(Object sender, DoWorkEventArgs e)
at BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at BackgroundWorker.WorkerThreadStart(Object argument)
at StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
at AgileAsyncWorkerItem.DoAsyncCall()
at AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at ThreadPoolWorkQueue.Dispatch()
at _ThreadPoolWaitCallback.PerformWaitCallback()
>MiniDump: TraceDirectory setting not set or missing. Defaulting to temporary folder.
[2012-04-15 08:55:56.376] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread: 11 |Category: Application.Outlook |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ClientAuthProvidersFactory`1.SignIn
at ClientAuthProvidersFactory`1.SignIn(Uri endPoint, Credential credentials, AuthUIMode uiMode, IClientOrganizationContext context, Form parentWindow, Boolean retryOnError)
at DeploymentInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow, Credential credentials)
at DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
at DeploymentsInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow)
at ServerForm.LoadOrganizations(Boolean forceUI)
at ServerForm.<InitializeBackgroundWorkers>b__0(Object sender, DoWorkEventArgs e)
at BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at BackgroundWorker.WorkerThreadStart(Object argument)
at StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
at AgileAsyncWorkerItem.DoAsyncCall()
at AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at ThreadPoolWorkQueue.Dispatch()
at _ThreadPoolWaitCallback.PerformWaitCallback()
>Silent sign-in failed and requested UiMode is silentonly. Failing authentication process.
[2012-04-15 08:55:56.376] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread: 11 |Category: Application.Outlook |User: 00000000-0000-0000-0000-000000000000 |Level: Error | DeploymentsInfo.InternalLoadOrganizations
at DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
at DeploymentsInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow)
at ServerForm.LoadOrganizations(Boolean forceUI)
at ServerForm.<InitializeBackgroundWorkers>b__0(Object sender, DoWorkEventArgs e)
at BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at BackgroundWorker.WorkerThreadStart(Object argument)
at StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
at AgileAsyncWorkerItem.DoAsyncCall()
at AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at ThreadPoolWorkQueue.Dispatch()
at _ThreadPoolWaitCallback.PerformWaitCallback()
>Exception during Signin Microsoft.Crm.CrmException: Credentials required
at Microsoft.Crm.Outlook.ClientAuth.ClaimsBasedAuthProvider`1.AuthenticateClaims()
at Microsoft.Crm.Outlook.ClientAuth.ClaimsBasedAuthProvider`1.SignIn()
at Microsoft.Crm.Outlook.ClientAuth.ClientAuthProvidersFactory`1.SignIn(Uri endPoint, Credential credentials, AuthUIMode uiMode, IClientOrganizationContext context, Form parentWindow, Boolean retryOnError)
at Microsoft.Crm.Application.Outlook.Config.DeploymentsInfo.DeploymentInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow, Credential credentials)
at Microsoft.Crm.Application.Outlook.Config.DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
[2012-04-15 08:55:58.290] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread: 11 |Category: Application.Outlook |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | ClientAuthProvidersFactory`1.RetrieveUserCredentialsAndSignIn
at ClientAuthProvidersFactory`1.RetrieveUserCredentialsAndSignIn(Uri endPoint, Credential credentials, Form parentWindow, Boolean retryOnError, IClientOrganizationContext context)
at ClientAuthProvidersFactory`1.SignIn(Uri endPoint, Credential credentials, AuthUIMode uiMode, IClientOrganizationContext context, Form parentWindow, Boolean retryOnError)
at DeploymentInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow, Credential credentials)
at DeploymentsInfo.InternalLoadOrganizations(OrganizationDetailCollection orgs, AuthUIMode uiMode, Form parentWindow)
at DeploymentsInfo.LoadOrganizations(AuthUIMode uiMode, Form parentWindow)
at ServerForm.LoadOrganizations(Boolean forceUI)
at ServerForm.<InitializeBackgroundWorkers>b__0(Object sender, DoWorkEventArgs e)
at BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at BackgroundWorker.WorkerThreadStart(Object argument)
at StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
at AgileAsyncWorkerItem.DoAsyncCall()
at AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at ThreadPoolWorkQueue.Dispatch()
at _ThreadPoolWaitCallback.PerformWaitCallback()
>Creating a client authentication form.
[2012-04-15 08:56:47.023] Process:Microsoft.Crm.Application.Outlook.ConfigWizard |Organization:00000000-0000-0000-0000-000000000000 |Thread: 12 |Category: Application.Outlook |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ClientAuthProvider`1.HandleAuthenticationFailures
at ClientAuthProvider`1.HandleAuthenticationFailures(Action method)
at ClaimsBasedAuthProvider`1.AuthenticateClaims()
at ClaimsBasedAuthProvider`1.SignIn()
at ClientAuthProvidersFactory`1.HandleCredentialsEntered(Object sender, CredentialsEventArgs e)
at ClientAuthForm.SignInAsync(Object value)
at QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at ExecutionContext.runTryCode(Object userData)
at RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at ThreadPoolWorkQueue.Dispatch()
at _ThreadPoolWaitCallback.PerformWaitCallback()
>Exception when trying to authenticate:System.ServiceModel.Security.MessageSecurityException: The security timestamp is invalid because its creation time ('2012-04-15T12:05:07.838Z') is in the future. Current time is '2012-04-15T11:56:46.863Z' and allowed clock skew is '00:05:00'.
Server stack trace:
at System.ServiceModel.Security.SecurityTimestamp.ValidateFreshness(TimeSpan timeToLive, TimeSpan allowedClockSkew)
at System.ServiceModel.Security.SecurityTimestamp.ValidateRangeAndFreshness(TimeSpan timeToLive, TimeSpan allowedClockSkew)
at System.ServiceModel.Security.ReceiveSecurityHeader.ReadTimestamp(XmlDictionaryReader reader)
at System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader reader)
at System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader, XmlDictionaryReader reader)
at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)
at System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessageCore(Message& message, TimeSpan timeout)
at System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout)
at System.ServiceModel.Security.SecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
….
So, I came to the point that it was something wrong with my clock, smelling like the ‘already typical’ issue with CRM Outlook client when there is a difference bigger than 5 minutes between server and client.
Solution
Once identified the actual problem, solution was pretty easy. Just adjusted my clock to be the same as server (timezone and time) and after that, I could successfully set up my Outlook client.
Hope it helps you out,
PP [twitter: @pabloperalta]
UruIT Dynamix | Excellence in Dynamics CRM Nearshoring Services.