def __init__(self, operations_mod, client_class, consumer_class, msgfactory, chk_factory, conversation_cls): OAuth2.__init__(self, operations_mod, client_class, msgfactory, chk_factory, conversation_cls) #self._parser.add_argument('-R', dest="rsakey") self._parser.add_argument( '-i', dest="internal_server", action='store_true', help="Whether or not an internal web server to handle key export should be forked") self._parser.add_argument( '-e', dest="external_server", action='store_true', help="A external web server are used to handle key export") self.consumer_class = consumer_class
def parse_args(self): OAuth2.parse_args(self) if self.args.external_server: self.environ["keyprovider"] = None _keyjar = self.client.keyjar pcr = ProviderConfigurationResponse() n = 0 for param in URL_TYPES: if param in self.pinfo: n += 1 pcr[param] = self.pinfo[param] if n: _keyjar.load_keys(pcr, self.pinfo["issuer"])
def __init__(self, operations_mod, client_class, consumer_class, msgfactory, chk_factory, conversation_cls): OAuth2.__init__(self, operations_mod, client_class, msgfactory, chk_factory, conversation_cls) # self._parser.add_argument('-R', dest="rsakey") self._parser.add_argument( "-i", dest="internal_server", action="store_true", help="Whether or not an internal web server to handle key export should be forked", ) self._parser.add_argument( "-e", dest="external_server", action="store_true", help="A external web server are used to handle key export", ) self._parser.add_argument("-S", dest="script_path", help="Path to the script running the static web server") self.consumer_class = consumer_class
def parse_args(self): OAuth2.parse_args(self) if self.args.external_server: self.environ["keyprovider"] = None _keyjar = self.client.keyjar pcr = ProviderConfigurationResponse() n = 0 for param in URL_TYPES: if param in self.pinfo: n += 1 pcr[param] = self.pinfo[param] if n: if _keyjar is None: _keyjar = self.client.keyjar = KeyJar() _keyjar.load_keys(pcr, self.pinfo["issuer"])
def __init__(self, operations_mod, client_class, consumer_class, msgfactory, chk_factory, conversation_cls): OAuth2.__init__(self, operations_mod, client_class, msgfactory, chk_factory, conversation_cls) #self._parser.add_argument('-R', dest="rsakey") self._parser.add_argument( '-i', dest="internal_server", action='store_true', help= "Whether or not an internal web server to handle key export should be forked" ) self._parser.add_argument( '-e', dest="external_server", action='store_true', help="A external web server are used to handle key export") self._parser.add_argument( '-S', dest="script_path", help="Path to the script running the static web server") self.consumer_class = consumer_class
#!/usr/bin/env python __author__ = 'rohe0002' from oic.oauth2 import Client from oic.oauth2 import factory as message_factory from oauth2test import OAuth2 from oauth2test import operations from oauth2test.base import Conversation from oauth2test.check import factory as check_factory cli = OAuth2(operations, Client, message_factory, check_factory, Conversation) cli.run()