oauth2_client/fetcher.py
def jwt_claim(self, expiration_s=150):
        """
        Build a JWT claim used to obtain token from auth provider.
        Logic and naming explained here:
        https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.html
        https://tools.ietf.org/html/rfc7523

        Args:
            expiration_s (int): value for `exp` claim field. Per RFC has to be <= 180s

        Returns:
            str: claim as base64 string
        """
        claim = urlsafe_b64encode('{"alg":"RS256"}'.encode()).decode()
        claim += "."
        expiration_ts = int(datetime_to_float(timezone.now() + timedelta(seconds=expiration_s)))
        claim_template = '{{"iss": "{iss}", "sub": "{sub}", "aud": "{aud}", "exp": {exp}}}'
        payload = claim_template.format(
            iss=self.app.client_id,  # issuer
            sub=self.app.extra_settings['subject'],
            aud=self._audience(),
            exp=expiration_ts
        )
        log.debug("JWT flow claim payload: %s", payload)
        claim += urlsafe_b64encode(payload.encode()).decode()
        return claim

        Build a JWT claim used to obtain token from auth provider.
        Logic and naming explained here:
        https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.html
        https://tools.ietf.org/html/rfc7523

        Args:
            expiration_s (int): value for `exp` claim field. Per RFC has to be <= 180s

        Returns:
            str: claim as base64 string
        
Build a JWT claim used to obtain token from auth provider.
Build a JWT claim used to obtain token from auth provider .
def jwt_claim(self, expiration_s=150):
        claim = urlsafe_b64encode('{"alg":"RS256"}'.encode()).decode()
        claim += "."
        expiration_ts = int(datetime_to_float(timezone.now() + timedelta(seconds=expiration_s)))
        claim_template = '{{"iss": "{iss}", "sub": "{sub}", "aud": "{aud}", "exp": {exp}}}'
        payload = claim_template.format(
            iss=self.app.client_id,  
            sub=self.app.extra_settings['subject'],
            aud=self._audience(),
            exp=expiration_ts
        )
        log.debug("JWT flow claim payload: %s", payload)
        claim += urlsafe_b64encode(payload.encode()).decode()
        return claim
def jwt_claim ( self , expiration_s = 150 ) : claim = urlsafe_b64encode ( '{"alg":"RS256"}' . encode ( ) ) . decode ( ) claim += "." expiration_ts = int ( datetime_to_float ( timezone . now ( ) + timedelta ( seconds = expiration_s ) ) ) claim_template = '{{"iss": "{iss}", "sub": "{sub}", "aud": "{aud}", "exp": {exp}}}' payload = claim_template . format ( iss = self . app . client_id , sub = self . app . extra_settings [ 'subject' ] , aud = self . _audience ( ) , exp = expiration_ts ) log . debug ( "JWT flow claim payload: %s" , payload ) claim += urlsafe_b64encode ( payload . encode ( ) ) . decode ( ) return claim
Build a JWT claim used to obtain token from auth provider.
Build a JWT claim used to obtain token from auth provider .
"""
        Build a JWT claim used to obtain token from auth provider.
        Logic and naming explained here:
        https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.html
        https://tools.ietf.org/html/rfc7523

        Args:
            expiration_s (int): value for `exp` claim field. Per RFC has to be <= 180s

        Returns:
            str: claim as base64 string
        """ # issuer
claim as base64 string
claim as base64 string
str
self
expiration_s
value for `exp` claim field. Per RFC has to be <= 180s
value for ` exp ` claim field . Per RFC has to be < = 180s