Integrations/MicrosoftGraphFiles/MicrosoftGraphFiles.py
def return_token_and_save_it_in_context(self, access_token_response):
        """
        this function saves the received access token in demisto context
        :param access_token_response: access token
        :return: the new access token
        """
        access_token = access_token_response.get("access_token")

        if not access_token:
            return demisto.error("Access Token returned empty")
        expires_in = access_token_response.get("expires_in", 3595)
        time_buffer = 5  # seconds by which to shorten the validity period
        if expires_in - time_buffer > 0:
            # err on the side of caution with a slightly shorter access token validity period
            expires_in = expires_in - time_buffer

        demisto.setIntegrationContext(
            {"access_token": access_token, "valid_until": epoch_seconds() + expires_in}
        )
        return access_token

        this function saves the received access token in demisto context
        :param access_token_response: access token
        :return: the new access token
        
this function saves the received access token in demisto context
this function saves the received access token in demisto context
def return_token_and_save_it_in_context(self, access_token_response):
        access_token = access_token_response.get("access_token")
        if not access_token:
            return demisto.error("Access Token returned empty")
        expires_in = access_token_response.get("expires_in", 3595)
        time_buffer = 5  
        if expires_in - time_buffer > 0:
            expires_in = expires_in - time_buffer
        demisto.setIntegrationContext(
            {"access_token": access_token, "valid_until": epoch_seconds() + expires_in}
        )
        return access_token
def return_token_and_save_it_in_context ( self , access_token_response ) : access_token = access_token_response . get ( "access_token" ) if not access_token : return demisto . error ( "Access Token returned empty" ) expires_in = access_token_response . get ( "expires_in" , 3595 ) time_buffer = 5 if expires_in - time_buffer > 0 : expires_in = expires_in - time_buffer demisto . setIntegrationContext ( { "access_token" : access_token , "valid_until" : epoch_seconds ( ) + expires_in } ) return access_token
this function saves the received access token in demisto context
this function saves the received access token in demisto context
"""
        this function saves the received access token in demisto context
        :param access_token_response: access token
        :return: the new access token
        """ # seconds by which to shorten the validity period # err on the side of caution with a slightly shorter access token validity period
the new access token
the new access token
self
access_token_response
None