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

Dynamic Long Token Expiry Time #100

Open
anish10dec opened this issue Jun 10, 2022 · 1 comment
Open

Dynamic Long Token Expiry Time #100

anish10dec opened this issue Jun 10, 2022 · 1 comment

Comments

@anish10dec
Copy link

Is there a option to use long token expiry time from query params, so that long token expiry time is dynamic instead of default which is 86400 or controlled by "end" directive in module

http://example.com?longttl=3600

secure_token_akamai $live {
key 4044798f7f59bfd433ff72b2c1ccd8fc;
param_name hdnts;
end $arg_longttl;
acl "$secure_token_baseuri*";
}

@erankor
Copy link
Contributor

erankor commented Jun 10, 2022

Fully dynamic expiration is not supported, but you can define several tokens with different expirations, and map a variable to one of them.
Something like -

secure_token_akamai $short {
    key 1234;
    end 3600;
    ...
}
secure_token_akamai $long {
    key 1234;
    end 86400;
    ...
}
map $arg_token_type $token {
    "long" $long;
    default $short;
}

Btw, you should consider that unless you protect the query argument somehow, users can always choose the max expiration, so it doesn't provide any additional protection - it's the same as always using the max value...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants