Logo Search packages:      
Sourcecode: ubuntu-sso-client version File versions  Download package

def ubuntu_sso::main::LoginProcessor::get_config_urls (   self,
  realm 
)

Look up the URLs to use in the config file

Definition at line 119 of file main.py.

00119                                     :
        """Look up the URLs to use in the config file"""
        logger.debug("Fetching config URLs for realm='%s'", realm)
        if self.config.has_section(realm):
            logger.debug("Realm '%s' is in config", realm)
            request_token_url = self.__get_url(realm, "request_token_url")
            user_authorisation_url = self.__get_url(realm,
              "user_authorisation_url")
            access_token_url = self.__get_url(realm, "access_token_url")
            consumer_secret = self.__get_option(realm, "consumer_secret")
        elif realm.startswith("http://localhost") and \
          self.config.has_section("http://localhost"):
            logger.debug("Realm is localhost and is in config")
            request_token_url = self.__get_url("http://localhost",
              "request_token_url", realm)
            user_authorisation_url = self.__get_url("http://localhost",
              "user_authorisation_url", realm)
            access_token_url = self.__get_url("http://localhost",
              "access_token_url", realm)
            consumer_secret = self.__get_option("http://localhost",
              "consumer_secret")
        elif self.is_valid_url(realm):
            logger.debug("Realm '%s' is not in config", realm)
            request_token_url = self.__get_url("default",
              "request_token_url", realm)
            user_authorisation_url = self.__get_url("default",
              "user_authorisation_url", realm)
            access_token_url = self.__get_url("default",
              "access_token_url", realm)
            consumer_secret = self.__get_option(realm, "consumer_secret")
        else:
            logger.debug("Realm '%s' is a bad realm", realm)
            raise BadRealmError
        return (request_token_url, user_authorisation_url,
                access_token_url, consumer_secret)

    def is_valid_url(self, url):


Generated by  Doxygen 1.6.0   Back to index