I ran into this issue recently, so I thought I’d share the solution in case it helps someone else.
I was contacted by a user saying they can’t log in and are getting the following error: “There was an error trying to log you in“. The app in question uses a Blazor WASM frontend and an ASP.NET Core backend that uses IdentityServer for user accounts.
I tried logging into the app and it worked for me, it also worked for a bunch of other people. I even tried using a VPN to log in from different IPs and locations to see if that could help reproduce the problem. But the login always ended up working.
As it turned out the problem was actually on this user’s side. Their Windows system time was out of sync and the solution was to simply instruct the user to sync the system time: Control Panel -> Date and Time -> Internet Time -> Change settings -> Update now
Hope it helps.