Login Error in BC after changing Server Date | CloudFronts

Login Error in BC after changing Server Date

Introduction:

While doing some customization testing, which revolved around using different dates, I realized that once the date is switched back to the correct date, I was unable to connect to Business Central. I restarted the server instance, IIS, SQL Server services to no avail.

Prerequisite:

Business Central On-Premise setup with Web Server and SSL.

References:

https://serverfault.com/questions/217343/date-header-returned-by-iis7-is-wrong

https://support.microsoft.com/en-us/topic/using-net-stop-and-net-start-commands-to-force-iis-services-to-re-read-the-registry-c6fe0d0b-9893-36d0-cc3c-47d03f9ccdde

Verification:

Logging into Business Central gave no errors, there were no errors in the Event Viewer that explicitly mention that it is a Date related issue.

The way I stumbled across it being a date related issue is that in the Response that the Business Central server sent to the Login Request, was carrying the wrong date in it.

When I switched the System Date back to the date mentioned in the Response headers, everything seemed to be working again.

Elements 
Console Sources Network Performance 
Q Preserve log Disable cache Online 
Memory 
x 
Filter 
o 
CJ Hide data URLs 
XHR JS CSS Img Media Font Doc 
WS 
Manifest Other 
O Has blocked cookies C) Blocked Requests 
Microsoft 
User name: 
Password: 
Dynamics 365 
Business Central 
Sign In 
Name 
LJ Signln 
LJ Default 
desktop.css 
Header.png 
LJ data:application/x-... 
7 requests 112 kB transferred 
Console Whats New x 
12CO m, 
x Headers Preview Response Initiator Tim ing 
127.e.ø.I:443 
Referrer Policy: strict-origin-when-cross-origin 
Response Headers view source 
Cache-Control: no-store, no-cache 
Content-Length: 
Date: Fri, 05 Feb 2e21 GMT 
Expires: Thu, el Jan 197B GMT 
Location: /Dev/Default 
Pragma: no •cache 
Cookies 
2020 Microsoft. All rights I privacy Cookies 
Server 
Set-Coo kie: 
site—none ; 
Set-COO 
SessionId=eueuq5wxnmrehwIxkgzz0e2x; path=/Oev; secure; same 
httponly 
. spuetCore. fDJ8AkOqyRBBL 9Gn c t 
Highlights from the Chrome 88 update 
New CSS angle visualization tools 
Better visualize and edit CSS angle in the Styles pane. 
Emulate unsupported image types 
2 new emulations to disable AVIF and WebP image formats in the 
Rendering tab 
0402-21

Solution:

This issue is caused because when the system date is changed, the same is changed in IIS but when you change it back IIS does not refresh it and we have to manually reset it. Restarting it does not work, trust me, I tried.

One way to do this is to execute the following commands on the Server:

  1. net http stop
  2. net http start

These commands took a lot of time so be sure to have available down time before you run them.

The other way, which is much simpler in my opinion, is to simply restart the Server.

This stops all the services and restarts them which forces the IIS to reset as well.

Dynamics 365 Business Central 
Linchpin Pvt. Ltd. 
My Business Central 
LS Central 
Home 
- Retail Item List 
- Store List 
- pos Terminal List 
- Run POS 
- Retail Transfer Order List 
- Retail Purchase Orders 
Point Of Sale 
- Run POS 
- Retail Users 
- POS (12) 
- Interface (11) 
- Data (10) 
- Functionality (8) 
- Appearance (4) 
- Hardware (8) 
BackOffice (5) 
- Product Design (5) 
- Sales & Marketing (3) 
Filter 
Find 
Explore all 
Expand 
I Collapse I 
Elements Console Sources Network Performance Memory 
Y Q Preserve log Disable cache Online 
o 
LJ Hide data URLs 
XHR JS CSS Irng Media Font 
01 
Doc WS Manifest Other 
Has blocked cookies (J Blocked Requests 
500 ms 
Name 
loco ms 
1500 ms 
2500 ms 
3000 ms 
3500 ms 
500 ms 
x Headers Preview Response Initiator Timing 
127.e.ø.E443 
Referrer policy: strict-origin-when-cross-origin 
Cookies 
Signln 
LJ desktop 
LJ 160.15884.1594 
splash.png?aid = NAV 
LJ jguery-3.3.1.min.js?h-F6626C. 
43 requests 4.1 MB transferred 
Response Headers 
cache-control: no-store, no-cache 
content-encoding: gzip 
content-security-policy: frame- ancestors 
content-type: text/html; charset-utf-8 
date: Tue, 15 Feb 2021 GMT 
pragma: no- cache 
' self 
set-cookie: SessåonId=yupIågpød3qfhevum21kqhzi; path=/Dev; secure; same 
site—none; httponly 
strict-transport-security: max-age-31536Øee; includeSubDomain5 
vary: Accept -Encoding 
Console 4139722 B transferred over network 
Highlights from the Chrome 88 update 
New CSS angle visualization tools 
Better visualize and edit CSS angle in the Styles pane. 
Emulate unsupported image types 
2 new emulations to disable AVIF and WebP image formats in the 
Rendering tab. 
1247 PM 
A ENG 
16-02-21

Conclusion:

Thus in this blog, we saw how to resolve the issue of being unable to login after changing Server Date in Business Central.

Hope this helps!


Share Story :