sso: Increase timeout to 60 minutes

This is a temporary measure since no permanent solution was found for the cases
where auth_pubtkt cookie refresh fails when an application sends POST requests
only during the time a cookie refresh must happen. e.g. transmission and tt-rss

This at least makes the above applications usable for an hour. And then the user
must refresh the application on their web browser. This does not affect the
mobile apps.

The only other option for now is to disable SSO for the above applications till
we implement a better SSO solution which is undesirable since our users are
already used to the SSO feature.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati 2018-02-02 18:00:09 +05:30 committed by James Valleroy
parent c9c4957ddd
commit 5e20a47bf4
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -123,16 +123,15 @@ def subcommand_generate_ticket(arguments):
tokens = arguments.tokens
with open(private_key_file, 'r') as fil:
pkey = crypto.load_privatekey(crypto.FILETYPE_PEM, fil.read().encode())
valid_until = seconds_from_now(30)
grace_period = seconds_from_now(25)
print(create_ticket(
pkey, uid, valid_until, tokens=tokens, graceperiod=grace_period))
valid_until = minutes_from_now(60)
grace_period = minutes_from_now(55)
print(create_ticket(pkey, uid, valid_until, tokens=tokens,
graceperiod=grace_period))
# def minutes_from_now(minutes):
# """Return a timestamp at the given number of minutes from now."""
# return (datetime.datetime.now() + datetime.timedelta(
# 0, minutes * 60)).timestamp()
def minutes_from_now(minutes):
"""Return a timestamp at the given number of minutes from now."""
return seconds_from_now(minutes * 60)
def seconds_from_now(seconds):