function getSessionDurationForRole()

in tampermonkey.js [136:164]


  function getSessionDurationForRole($saml, role) {

    // Override value specified in SESSION_DURATION_OVERRIDES above
    if( SESSION_DURATION_OVERRIDES[role] ) {
      return SESSION_DURATION_OVERRIDES[role];
    }

    // SessionDuration attribute specified within SAML token
    try {

      const $attribute = $saml.find('[Name=\'https://aws.amazon.com/SAML/Attributes/SessionDuration\']')
      .filter((idx, element) => {
        return element.localName === 'Attribute' && element.namespaceURI === 'urn:oasis:names:tc:SAML:2.0:assertion';
      });
      
      if( $attribute && $attribute.length ) {
        const duration = $attribute.children(':first').text();
        if(duration >= 900 && duration <= 43200) { // allowed values are between 15 minutes and 12 hours
          return duration;
        }
      }
    } catch(err) {
      console.warn('Was not able to read SessionDuration attribute from SAML token');
      // Fall through to default value below
    }

    // Default value of 1 hour
    return 3600;
  }