Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckTokenTtl - not proper logic #229

Closed
wsmelton opened this issue Aug 23, 2021 · 0 comments
Closed

CheckTokenTtl - not proper logic #229

wsmelton opened this issue Aug 23, 2021 · 0 comments
Labels
authentication Endpoints or other involving authentication bug Something isn't working

Comments

@wsmelton
Copy link
Contributor

Verified issue does not already exist?

Yes

What error did you receive

No error

Please run the command using -Verbose

n/a

Provide a test case or steps to reproduce

Create a session and then use CheckTokenTtl(5). The method returns false until the timespan is 4 minutes or lower and does not account for it at 5 minutes.

Expected behavior

The intent would be getting notified when I'm at or under 5 minutes of the TimeOfDeath time value.

Take $session.TimeOfDeath - (Get-Date), the TotalMinutes value is not a whole number so when it gets to 5.12324 the comparison is no longer accurate. This should be comparing timestamp to timestamp.

So something like $session.TimeOfDeath -le (Get-Date).AddMinutes(5) should provide the expected behavior. If TimeOfDeath is still less than or equal the current timestamp.

What Edition of Secret Server?

Professional

What version of Secret Server

11.0

What PowerShell host was used when producing this error

PowerShell Core (pwsh)

PowerShell Host Version

7.1.4

@wsmelton wsmelton added bug Something isn't working triage needed new issues that are still in state of triage authentication Endpoints or other involving authentication and removed triage needed new issues that are still in state of triage labels Aug 23, 2021
wsmelton added a commit that referenced this issue Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authentication Endpoints or other involving authentication bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant