Exemplo n.º 1
0
    def _handle_unscoped_token(self, context, auth_payload):
        assertion = dict(utils.get_assertion_params_from_env(context))

        identity_provider = auth_payload['identity_provider']
        protocol = auth_payload['protocol']

        mapping = self.federation_api.get_mapping_from_idp_and_protocol(
            identity_provider, protocol)
        rules = jsonutils.loads(mapping['rules'])
        rule_processor = utils.RuleProcessor(rules)
        mapped_properties = rule_processor.process(assertion)
        utils.validate_groups(mapped_properties['group_ids'], mapping['id'],
                              self.identity_api)

        return {
            'user_id': parse.quote(mapped_properties['name']),
            'group_ids': mapped_properties['group_ids'],
            federation.IDENTITY_PROVIDER: identity_provider,
            federation.PROTOCOL: protocol
        }
Exemplo n.º 2
0
    def _handle_unscoped_token(self, context, auth_payload):
        assertion = dict(utils.get_assertion_params_from_env(context))

        identity_provider = auth_payload['identity_provider']
        protocol = auth_payload['protocol']

        mapping = self.federation_api.get_mapping_from_idp_and_protocol(
            identity_provider, protocol)
        rules = jsonutils.loads(mapping['rules'])
        rule_processor = utils.RuleProcessor(rules)
        mapped_properties = rule_processor.process(assertion)
        utils.validate_groups(mapped_properties['group_ids'],
                              mapping['id'], self.identity_api)

        return {
            'user_id': parse.quote(mapped_properties['name']),
            'group_ids': mapped_properties['group_ids'],
            federation.IDENTITY_PROVIDER: identity_provider,
            federation.PROTOCOL: protocol
        }
Exemplo n.º 3
0
 def _extract_assertion_data(self, context):
     assertion = dict(utils.get_assertion_params_from_env(context))
     return assertion
Exemplo n.º 4
0
 def _extract_assertion_data(self, context):
     assertion = dict(utils.get_assertion_params_from_env(context))
     user_id = context['environment'].get('REMOTE_USER')
     return user_id, assertion
Exemplo n.º 5
0
def extract_assertion_data(context):
    assertion = dict(utils.get_assertion_params_from_env(context))
    return assertion
Exemplo n.º 6
0
 def _extract_assertion_data(self, context):
     assertion = dict(utils.get_assertion_params_from_env(context))
     user_id = context['environment'].get('REMOTE_USER')
     return user_id, assertion