6

2

Related to the question about getting API token is another one ... how long is token valid? In my code, I usually perform logon at the beginning of user's session (when he starts eclipse and my plugin needs to access fogbugz for the first time), and then use it all the time. When program is restarted, new logon is performed.

I've never seen any problems related to this, but I am not sure if my code shouldn't be smarter about reusing old tokens.

So my questions are:

How long can I use one token? is it valid until logoff is explicitely executed? Is there some timeout (hours/days/months/years)? What happens when I perform many many many logons with same user? I think he gets new token each time ... can I "overflow" token database? (ok, in theory anyway :-))

flag

2 Answers

6

The API documentation it states:

The token can be used indefinitely, and will only be invalidated by executing a logoff command with that token

We've been using a systematic login and have done many thousands of logins. I don't think overflow is an issue you need to worry about.

link|flag
3

It does store a row in the table to track, so technically "indefinitely" is a bit inaccurate as your database would get too large at some point. It's best practices to log off the last token you used if you are going to log on again, or simply save the last token and not require another log on.

link|flag
When using same token, is API client notified when when administrator changes user credentials or disables the user? Will client get "not logged" error? – Peter Štibraný Dec 4 2009 at 10:49
1 
If admin changes the password or disables the user, the token will no longer be valid, so yes, they will get a not logged on error. – Michael Pryor Dec 4 2009 at 14:50
Will a log off through the web interface not decommission all tokens for the user? Thought I'd read that somewhere. – Rich Armstrong Dec 8 2009 at 0:00

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.