simpleidserver / SimpleIdServer

OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
https://simpleidserver.com/
Apache License 2.0
716 stars 94 forks source link

There was a problem converting all DateTime.UtcNow to DateTime.Now #704

Closed qq1176914912 closed 7 months ago

qq1176914912 commented 7 months ago

Hello, when I use vs to try to replace all "DateTimeUtcNow" with "DateTime.Now", sometimes 5002 gets an error when switching languages: image After this problem occurs, the 5002 page will be stuck, and it will display normally after refreshing the page. The database is still using the old database (the database after DateTime.UtcNow), and I find that this problem does not occur when I recreate a database or continue to use "DateTime.UtcNow". Here's how I replaced it: image A total of 363 were replaced. image

simpleidserver commented 7 months ago

Hello,

Why do you want to replace DateTime.UtcNow with DateTime.Now? By making this modification, you will break the Identity Server as the logic used to compute the iat (issue datetime) and exp (expiration datetime) parameters of an access token will be disrupted.

I assume you want to replace DateTime.UtcNow with DateTime.Now to transform the UTC DateTime into the local datetime on the website. I have made some modifications in the master branch to convert UTC datetime into your local time on the administration website.

qq1176914912 commented 7 months ago

Hello,

Why do you want to replace DateTime.UtcNow with DateTime.Now? By making this modification, you will break the Identity Server as the logic used to compute the iat (issue datetime) and exp (expiration datetime) parameters of an access token will be disrupted.

I assume you want to replace DateTime.UtcNow with DateTime.Now to transform the UTC DateTime into the local datetime on the website. I have made some modifications in the master branch to convert UTC datetime into your local time on the administration website.

Thank you for your reply. The reason for this change is that DateTimeUtcNow differs from the actual time in China by 8 hours. It seems that the time displayed in logs on address 5002 is utc time, so I want to try to change it to DateTimeNow to obtain the local time. Because of the difference of 8 hours, I am not sure whether the whole system will be affected if I follow your modification.

simpleidserver commented 7 months ago

In the administration website (https://localhost:5002/), I made some changes in the master branch to convert all UTC DateTime values into local datetime. Can you please try again?

qq1176914912 commented 7 months ago

In the administration website (https://localhost:5002/), I made some changes in the master branch to convert all UTC DateTime values into local datetime. Can you please try again?

Thanks again for your help, no problem has been found so far.