Skip to content

[4/n] Let user request a specific TTL for a token #8231

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

Open
wants to merge 2 commits into
base: device-tokens-api
Choose a base branch
from

Conversation

david-crespo
Copy link
Contributor

@david-crespo david-crespo commented May 28, 2025

Closes #8147.

Built on #8137, #8214, and #8227.

This is pretty straightforward, I think. The user gives us a TTL in seconds at token request time. We store it on the request row. When they come back in the later step to confirm the code and generate the token, we retrieve the TTL, validate that it is less than the silo max (if one is set), and we use it to generate the time_expires timestamp, which cannot be changed later.

One slightly surprising bit is that we can't validate the TTL against the silo max at initial request time because we don't have any idea what silo the user is associated with until the confirm step. So probably want to make sure we are handling TTL validation errors nicely in the web console, because I think that's where they will show up.

@david-crespo david-crespo force-pushed the device-auth-ttl branch 2 times, most recently from 67e596d to 1f03596 Compare May 29, 2025 15:23
@david-crespo david-crespo force-pushed the device-auth-ttl branch 2 times, most recently from fb2efbe to 72c81dd Compare May 29, 2025 22:25
@david-crespo david-crespo marked this pull request as ready for review May 29, 2025 22:54
@david-crespo david-crespo force-pushed the device-auth-ttl branch 2 times, most recently from e9b8ab1 to 28485f3 Compare May 30, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant