ID0016 and ID2082: (setting) must be greater than TimeSpan.Zero.

YSOD in Identity Server:

ID2082: Lifetime must be greater than or equal to TimeSpan.Zero.
ID0016: The value must specify a time span greater than TimeSpan.Zero.
Parameter name: value

This is another one of those “I want to kick myself” sort of errors.

First of all: this is probably no big deal if you always adhere to the solemn oath: “I will always make a backup of my Identity Server database, before I make any configuration changes. So help me God.”

However, if you forgot to do this, there is still hope. Open SSMS. Connect to your Identity Server database. Run this query:

select * from dbo.GlobalConfiguration

Look at “DefaultTokenLifetime”, “MaximumTokenLifeTime” and “SsoCookieLifetime”. You need to fix those.
Before you do any more damage, make a backup. Remember: if you have too many backups, you can always delete the extra ones, but if you don’t have enough backups, you might be doomed. Don’t be doomed.

Done making a backup? Okay. Next step: update those columns. You should never trust SQL queries that you find on the internet, (especially an UPDATE or DELETE query) but here is one anyway:

UPDATE dbo.GlobalConfiguration SET SsoCookieLifetime=1 
WHERE SsoCookieLifetime=0;
UPDATE dbo.GlobalConfiguration SET MaximumTokenLifetime=1 
WHERE MaximumTokenLifetime=0;

Problem solved.


About Tim Golisch

I'm a geek. I do geeky things.
This entry was posted in Errors, Lessons Learned and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s