Exemplo n.º 1
0
def get_oauth_strings():
  domain = environ['HTTP_HOST']
  if domain == 'www.wheredoyougo.net':
    consumer_key = 'KTNXGQJ4JXDZGAG35MGZ3WN0EQIO5XHNALYQZATHVEPDR3TI'
    callback_url = 'http://www.wheredoyougo.net/authenticated'
  elif domain == 'where-do-you-go.appspot.com':
    consumer_key = 'S1PL51GWSZORANT244XXZC2UXIZGUUPGGNWNA3YHDGWM4M4U'
    callback_url = 'http://where-do-you-go.appspot.com/authenticated'
  elif domain == 'www.heredoyougo.com':
    consumer_key = 'EGB1JZBOMTTNBPVDCHVB3VGGMIXMEYIJKPPTCQGKMPQ4NPCY'
    callback_url = 'http://www.heredoyougo.com/authenticated'
  else:
    consumer_key = ''
    callback_url = ''
    logging.error('No Foursquare OAuth consumer key found for domain ' + domain)
  return (consumer_key, oauth_secrets.get_oauth_consumer_secret_for_domain(domain), callback_url)
Exemplo n.º 2
0
def get_oauth_strings(force_primary_domain=False):
    if force_primary_domain:  # I was getting SIGNATURE_INVALID oauth errors on many of my backend calls because
        # I was not using the same domain for the requests as I was when the users signed up
        # Always forcing this will break support for other domains, but will fix some OAuth
        # issues, so that's what I'm doing for now.
        domain = "www.wheredoyougo.net"
    else:
        domain = environ["HTTP_HOST"]
    logging.info("-------------------------------")
    logging.info(domain)
    if domain == "www.wheredoyougo.net":
        consumer_key = "KTNXGQJ4JXDZGAG35MGZ3WN0EQIO5XHNALYQZATHVEPDR3TI"
        callback_url = "http://www.wheredoyougo.net/authenticated"
    elif domain == "where-do-you-go-hrd.appspot.com":
        consumer_key = "1MVIIQ4S50Z0G3GRXYPG4PYFH44TYFAIZKG431CFLPQOVOND"
        callback_url = "http://where-do-you-go-hrd.appspot.com/authenticated"
    else:
        consumer_key = ""
        callback_url = ""
        logging.error("No Foursquare OAuth consumer key found for domain " + domain)
    return consumer_key, oauth_secrets.get_oauth_consumer_secret_for_domain(domain), callback_url
Exemplo n.º 3
0
def get_oauth_strings(force_primary_domain=True):
  if force_primary_domain: # I was getting SIGNATURE_INVALID oauth errors on many of my backend calls because 
                           # I was not using the same domain for the requests as I was when the users signed up
                           # Always forcing this will break support for other domains, but will fix some OAuth
                           # issues, so that's what I'm doing for now.
      domain = 'www.wheredoyougo.net'
  else:
      domain = environ['HTTP_HOST']
  if domain == 'www.wheredoyougo.net':
    consumer_key = 'KTNXGQJ4JXDZGAG35MGZ3WN0EQIO5XHNALYQZATHVEPDR3TI'
    callback_url = 'http://www.wheredoyougo.net/authenticated'
  elif domain == 'where-do-you-go.appspot.com':
    consumer_key = 'S1PL51GWSZORANT244XXZC2UXIZGUUPGGNWNA3YHDGWM4M4U'
    callback_url = 'http://where-do-you-go.appspot.com/authenticated'
  elif domain == 'www.heredoyougo.com':
    consumer_key = 'EGB1JZBOMTTNBPVDCHVB3VGGMIXMEYIJKPPTCQGKMPQ4NPCY'
    callback_url = 'http://www.heredoyougo.com/authenticated'
  else:
    consumer_key = ''
    callback_url = ''
    logging.error('No Foursquare OAuth consumer key found for domain ' + domain)
  return consumer_key, oauth_secrets.get_oauth_consumer_secret_for_domain(domain)#, callback_url)
Exemplo n.º 4
0
def get_oauth_strings(force_primary_domain=False):
    if force_primary_domain:  # I was getting SIGNATURE_INVALID oauth errors on many of my backend calls because
        # I was not using the same domain for the requests as I was when the users signed up
        # Always forcing this will break support for other domains, but will fix some OAuth
        # issues, so that's what I'm doing for now.
        domain = 'www.wheredoyougo.net'
    else:
        domain = environ['HTTP_HOST']
    logging.info('-------------------------------')
    logging.info(domain)
    if domain == 'www.wheredoyougo.net':
        consumer_key = 'KTNXGQJ4JXDZGAG35MGZ3WN0EQIO5XHNALYQZATHVEPDR3TI'
        callback_url = 'http://www.wheredoyougo.net/authenticated'
    elif domain == 'where-do-you-go-hrd.appspot.com':
        consumer_key = '1MVIIQ4S50Z0G3GRXYPG4PYFH44TYFAIZKG431CFLPQOVOND'
        callback_url = 'http://where-do-you-go-hrd.appspot.com/authenticated'
    else:
        consumer_key = ''
        callback_url = ''
        logging.error('No Foursquare OAuth consumer key found for domain ' +
                      domain)
    return consumer_key, oauth_secrets.get_oauth_consumer_secret_for_domain(
        domain), callback_url