code: def assertion_jwt(client_id, keys, audience, algorithm, lifetime=600):
      
      _now = utc_time_sans_frac()
  
      at = AuthnToken(iss=client_id, sub=client_id,
                      aud=audience, jti=rndstr(32),
                      exp=_now + lifetime, iat=_now)
      logger.debug('AuthnToken: {}'.format(at.to_dict()))
      return at.to_jwt(key=keys, algorithm=algorithm)
docs: Create a signed Json Web Token containing some information.
  
      :param client_id: The Client ID
      :param keys: Signing keys
      :param audience: Who is the receivers for this assertion
      :param algorithm: Signing algorithm
      :param lifetime: The lifetime of the signed Json Web Token
      :return: A Signed Json Web Token