AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.07.2019, 18:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
crmtipoftheday: Tip #1286: Synchronize your watches
Источник: https://crmtipoftheday.com/1286/sync...-your-watches/
==============

&tl;dr

If you’re using CrmServiceClient and getting what seems to be a valid connection but cannot really use it because of the “The user authentication failed!” error, check the servers’ clocks in your infrastructure.

Bo-o-o-oring

I have some perfect reasonable code deployed in Azure and that code has been humming along, talking to Dynamics 365 On-Premises for as long as I can remember. The code uses Xrm Tooling (yes, from time to time we listen to our own advice). Then one day – kabrakeeboom! – we get the log full of the following messages

Message: The user authentication failed!
StackTrace: at Microsoft.Xrm.Tooling.Connector
.CrmServiceClient.Execute(OrganizationRequest request)
blah-blah, our code
Quick check with the customer’s technical support – nothing has changed, no updates were installed on any of the servers. Sample code to troubleshoot:

string cs = "bleugh";using (var client = new CrmServiceClient(cs)) { if (client.IsReady) { Trace.WriteLine($"{client.GetMyCrmUserId()}"); var foo = client.Execute(new WhoAmIRequest()) as WhoAmIResponse; Trace.WriteLine($"{foo.UserId}"); }}Here’s the kick: IsReady is true and GetMyCrmUserId returns a valid value (probably cached) but Execute spits out “The user authentication failed”. Adding logging showed that coveted token gets invalidated immediately after the connection is made. It gets better: XrmToolBox would successfully connect to the instance as well but any attempt to use anything pops up “The user authentication failed!”


I’ll spare you the pain of ADFS debugging.

You know how they always synchronize watches in the action movies (there is even a song about it)? Now I know the reason.



ADFS server had its clock synchronized with the time service that was drifting over the time. Into the future. Once the drift was over 2 minutes, ADFS continued to issue tokens but they now were invalid the moment they left the server. Why nobody noticed and UI didn’t break? Because Dynamics 365 server was drifting as well, perfectly in sync with ADFS.



Источник: https://crmtipoftheday.com/1286/sync...-your-watches/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crmtipoftheday: Tip #1103: Chart styling cheat sheet Blog bot Dynamics CRM: Blogs 0 08.04.2018 03:03
crmtipoftheday: Tip #1095: Add percentage labels to pie charts Blog bot Dynamics CRM: Blogs 0 02.04.2018 04:16
crmtipoftheday: Tip #1060: Quickly create vector/SVG images for Dynamics 365 Blog bot Dynamics CRM: Blogs 0 24.01.2018 22:11
crmtipoftheday: Tip #1007: What is the Common Data Service (CDS) today? Blog bot Dynamics CRM: Blogs 0 23.10.2017 19:12
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 00:11.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.