I just enabled two factor authentication (2fa) on a few select users on my SuiteCRM 7.10.4/Ubuntu 16.04 instance and I found that the tokens (email codes) don’t seem to expire. This was confusing at first because I had generated a token the night before, received the email with the code, but did not use it and when I went to log in the next morning I never received another email. I had assumed that like most 2fa systems that the code would expire after some time (15 minutes, an hour, or whatever) but the email code from the night before still worked. Is there any way to make the tokens expire automatically after some specified time?
I also see a lot of noise in the suitecrm.log like:
Wed Apr 11 07:47:16 2018 [4947][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token is not sent yet, do we send a token to user
Wed Apr 11 07:48:21 2018 [5015][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token is not sent yet, do we send a token to user
Wed Apr 11 07:49:26 2018 [4801][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token is not sent yet, do we send a token to user
Wed Apr 11 07:50:30 2018 [4802][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token is not sent yet, do we send a token to user
Wed Apr 11 07:51:37 2018 [4880][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token is not sent yet, do we send a token to user
Wed Apr 11 07:52:43 2018 [4801][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token is not sent yet, do we send a token to user
Wed Apr 11 07:53:48 2018 [4798][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token is not sent yet, do we send a token to user
Wed Apr 11 07:57:38 2018 [4801][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token already sent
Wed Apr 11 07:58:06 2018 [4798][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token is not sent yet, do we send a token to user
Wed Apr 11 07:59:10 2018 [5015][316cc89c-7590-6a43-308c-57923a9221a7][FATAL] DEBUG: token is not sent yet, do we send a token to user
It looks like every minute that there is a token sent out but not used I get the “token is not sent yet, do we send a token to user” message and whenever a token is created I get the “token already sent” message. I don’t believe I have a “debug” setting turned on but perhaps I missed something.