0

I have a new PC, in my new PC while running the ASP.NET MVC I'm working on with Visual Studio, in the first day everything worked fine! The same with my old PC and with the environments where this software is running.

The problem happens since the second day I ran the same ASP.NET MVC on my new PC and only happens in my new PC!

I run the software with VS 2019 and login to it with one of my test user accounts (until here everything is fine).

After being logged in, with every request I make to the Asp.net mvc, instead of the expected behaviour: watching the url going from the old path to the new. You see the url going from the old path, to the path "login.microsoft..." and then it goes to the new path.

Somehow only in my new pc every request redirects to login and then to the new path!

That behaviour is causing me problems and I need some help please.

It can't be the code because I'm running the same code in all the other machines and they are working fine, maybe as to do with IIS!?

Best regards!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
MarchalPT
  • 1,268
  • 9
  • 28
  • It's trying to get your credentials first before it goes to your web app. On your new PC, does it requires you to login first? – Josh Apr 23 '20 at 14:38
  • Yes on my new PC works like the other in the begining asks for me to login, then i use my credentials, after that the others work fine with every request they already have the credentials. With this new PC after login it keeps redirecting to the login and then it goes to the path I requested. When it redirects to login it doesn't asks for the credentials because they are already filled but keeps going like this: from localhost:**** to login.microsoft... and then automatically goes to localhost:****/newPath – MarchalPT Apr 23 '20 at 16:09
  • is your IIS separately installed or IIS express? – Jerdine Sabio Apr 23 '20 at 17:08
  • I think it is installed with Visual Studio, by the way i rebooted the PC and is working again like it was in the beginning but I fear that it may happend again. I rebooted because I tried almost every thing: uninstaling VS and its root, getting the code from the repository again, uninstaling browser ... – MarchalPT Apr 23 '20 at 21:27

1 Answers1

0

I found what it was and it makes no sence that this happens!!

The problem is about the date time on my pc!? So after reboot I runned my ASP.NET MVC program and it worked fine, then i started trying stuff to see try replicate what was happening!

By default date time in my PC with windows automatic definition of hours and timezone, comes with one our less.

So without realising that setting the hour manually would became a problem while running my program in localhost I setted it to more one hour...

That redirect to login started happening! The thing is that my token expires after one hour and manually adding one hour to time clock in my pc made that every token the program sended to be already expired!

It as some logic but it doesn't make much sence why it happens?? Why the program doesn't send the token in the machine time and sends it one hour less, which is the time that automatic setted by windows, my machine gets??

After reproducing the error, I putted the hour back to automatic and this error happens:

OpenIdConnectProtocolValidationContext.Nonce was null

Here is the error and its solutions:

OpenIdConnectProtocolValidationContext.Nonce was null

For this error I just closed the browser and cleaned its cookies!

Thank you guys!

MarchalPT
  • 1,268
  • 9
  • 28