def test_authz_service_conf(): srv = factory('Authorization', client_authn_method=CLIENT_AUTHN_METHOD, conf={ 'request_args': { 'claims': { "id_token": { "auth_time": { "essential": True }, "acr": { "values": ["urn:mace:incommon:iap:silver"] } } } } }) client_config = { 'client_id': 'client_id', 'client_secret': 'password', 'redirect_uris': ['https://example.com/cli/authz_cb'], 'behaviour': { 'response_types': ['code'] } } cli_info = ClientInfo(keyjar, config=client_config) req = srv.construct(cli_info) assert 'claims' in req assert set(req['claims'].keys()) == {'id_token'}
def create_request(self): self.req = factory('Authorization', client_authn_method=CLIENT_AUTHN_METHOD) client_config = { 'client_id': 'client_id', 'client_secret': 'password', 'redirect_uris': ['https://example.com/cli/authz_cb'] } self.cli_info = ClientInfo(keyjar, config=client_config)
def create_request(self): self.req = factory('AccessToken', client_authn_method=CLIENT_AUTHN_METHOD) client_config = { 'client_id': 'client_id', 'client_secret': 'password', 'redirect_uris': ['https://example.com/cli/authz_cb'] } self.cli_info = ClientInfo(keyjar, config=client_config) self.cli_info.state_db['state'] = {'code': 'access_code'}
def create_request(self): self.req = factory('WebFinger', client_authn_method=CLIENT_AUTHN_METHOD) client_config = { 'redirect_uris': ['https://example.com/cli/authz_cb'], 'requests_dir': 'requests', 'base_url': 'https://example.com/cli/', 'resource': '*****@*****.**' } self.cli_info = ClientInfo(config=client_config) self.cli_info.service = build_services(DEFAULT_SERVICES, factory, None, None, CLIENT_AUTHN_METHOD)
def create_request(self): self.req = factory('CheckID', client_authn_method=CLIENT_AUTHN_METHOD) self._iss = 'https://example.com/as' client_config = { 'client_id': 'client_id', 'client_secret': 'password', 'redirect_uris': ['https://example.com/cli/authz_cb'], 'issuer': self._iss, 'requests_dir': 'requests', 'base_url': 'https://example.com/cli/' } self.cli_info = ClientInfo(config=client_config) self.cli_info.service = build_services(DEFAULT_SERVICES, factory, None, None, CLIENT_AUTHN_METHOD)
def create_request(self): self.req = factory('ProviderInfoDiscovery', client_authn_method=CLIENT_AUTHN_METHOD) self._iss = 'https://example.com/as' client_config = { 'client_id': 'client_id', 'client_secret': 'password', 'redirect_uris': ['https://example.com/cli/authz_cb'], 'issuer': self._iss, 'client_prefs': { 'id_token_signed_response_alg': 'RS384', 'userinfo_signed_response_alg': 'RS384' } } self.cli_info = ClientInfo(config=client_config) self.cli_info.service = build_services(DEFAULT_SERVICES, factory, None, None, CLIENT_AUTHN_METHOD)
def test_request_factory(): req = factory('Service', httplib=None, keyjar=None, client_authn_method=None) assert isinstance(req, Service)