Esempio n. 1
0
    def attributes(self, attributes_names='uid', subjectid=''):
        data = GET(
            ''.join((self.opensso_url, REST_OPENSSO_ATTRIBUTES)),
            params = {'attributes_names':attributes_names, 'subjectid':subjectid},
        )

        attribute_value = ''
        lines = data.splitlines()
        for i, line in enumerate(lines):
            if line == 'userdetails.attribute.name=%s' % attributes_names:
                attribute_value = lines[i + 1].split('=')[1]
                break

        return attribute_value.strip()
Esempio n. 2
0
    def attributes(self, attributes_names='uid', subjectid=''):
        data = GET(
            ''.join((self.opensso_url, REST_OPENSSO_ATTRIBUTES)),
            params={
                'attributes_names': attributes_names,
                'subjectid': subjectid
            },
        )

        attribute_value = ''
        lines = data.splitlines()
        for i, line in enumerate(lines):
            if line == 'userdetails.attribute.name=%s' % attributes_names:
                attribute_value = lines[i + 1].split('=')[1]
                break

        return attribute_value.strip()