kspearrin / kspearrin/Otp.NET

Any workaround for "top of the minute" & "bottom of the minute" boundaries?

Open
#48 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.3k
Forks
179
PR merge metrics
No merged PRs in 30d

Description

Previously I added this question as a comment in #43 but I believe this merits a new post of its own because it is a different question.

The following problem assume a default expiry duration of 30 seconds is used.

If I create a new token at `10:15:00` current time, it gets expired at `10:15:30` current time, which is as expected, but when I create a new token at let's say `10:15:28` current time, it is expired after 2 seconds at `10:15:30` time mark, instead of expiring after 30 seconds.

I want my tokens to expire after exact 30 (or `N`) seconds, no matter I generate them at "top of the minute" or "bottom of the minute" boundaries. Is it possible?

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file, entry point, or test is named in the issue. Start by tracing how the default 30-second expiry and token timestamps are handled, then determine whether expiry can be based on the token creation time; done means tokens consistently remain valid for the requested duration, including near minute boundaries, with coverage for both examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
authentication, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.