• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rchouinard / rych-otp / 41
93%

Build:
DEFAULT BRANCH: master
Ran 05 Aug 2016 02:38AM UTC
Jobs 3
Files 4
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
41

Pull #9

travis-ci

web-flow
Allow tokens to drift away from real time

Over a period of years, the clock in a physical OTP device drifts slowly away from the exact time because it has no way of syncing with the internet (!). We use Feitian c200 tokens. The manufacturer spec is +- 3 periods (of 30 sec each) _per year_. Most tokens are within that tolerance, but a good number fall outside that. We have about 1200 tokens in use at the moment.

To handle this, we need to store the current token offset in a database along with the token secret. The pull request allows us to pass that offset back in so that a token that has drifted well away from real time can still be used to authenticate. At authentication time, we calculate the current offset and use it to re-calibrate the token. So no matter how much the token drifts over time, if the user keeps using it regularly (every 6 months) they can still log in with it.

We also built a tool that allows users to resync their token: it sets the offset to zero, then accepts a very wide window (about 10 minutes either side) to calculate the initial offset. Once the offset is calculated and saved back to the database, the normal window size of 2 applies for all future logins.
Pull Request #9: Allow tokens to drift away from real time

14 of 14 new or added lines in 1 file covered. (100.0%)

161 of 174 relevant lines covered (92.53%)

54.55 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
100.0
src/TOTP.php
Jobs
ID Job ID Ran Files Coverage
2 41.2 05 Aug 2016 02:39AM UTC 0
92.53
Travis Job 41.2
3 41.3 05 Aug 2016 02:40AM UTC 0
92.53
Travis Job 41.3
4 41.4 05 Aug 2016 02:38AM UTC 0
92.53
Travis Job 41.4
Source Files on build 41
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #41
  • Pull Request #9
  • PR Base - master (#33)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc