How do you increase the token expiration time for a boto3.s3.transfer download?
<p>I am using boto3's s3.transfer to download several 4GB+ files from s3. All but one were able to download, but the one that failed gave the following error:</p>

<pre><code>ERROR: An error occurred (ExpiredToken) when calling the GetObject operation: The provided token has expired.
</code></pre>

<p>I am using it the same way it is document at <a href="http://boto3.readthedocs.org/en/latest/_modules/boto3/s3/transfer.html" rel="noreferrer">http://boto3.readthedocs.org/en/latest/_modules/boto3/s3/transfer.html</a></p>

<pre><code>s3_client = session.client('s3')
transfer = S3Transfer(s3_client)
# Download s3://bucket/key to /tmp/myfile
transfer.download_file('bucket', 'key', '/tmp/myfile')
</code></pre>

<p>Is there a way to increase the expiration time of the signed url used inside boto3?</p>

<p>In case it is relevant, I am using Cognito to get the credentials, and with them, a session</p>

<pre><code>    client = boto3.client('cognito-identity', AWS_REGION)

    # credentials[] contains the IdentityId and Token I get from my server
    # which I get using client.get_open_id_token_for_developer_identity 
    # with TokenDuration=86400
    resp = client.get_credentials_for_identity(IdentityId=credentials['IdentityId'],
                                               Logins={'cognito-identity.amazonaws.com': credentials['Token']})

    # The resp contains the actual temporary AWS secret/access codes and a session token, to be
    # used with the rest of the AWS APIs
    secretKey = resp['Credentials']['SecretKey']
    accessKey = resp['Credentials']['AccessKeyId']
    sessionToken = resp['Credentials']['SessionToken']

    session = Session(aws_access_key_id=accessKey,
                      aws_secret_access_key=secretKey,
                      aws_session_token=sessionToken,
                      region_name=AWS_REGION)

    s3_client = session.client('s3')
</code></pre>