-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathREADME
More file actions
37 lines (30 loc) · 1.45 KB
/
README
File metadata and controls
37 lines (30 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
python-opensso - Python interface to OpenSSO/OpenAM REST API
Code borrowed and reworked from django-opensso by nsb
https://github.com/nsb/django-opensso
The opensso.py module provided by django-opensso had a dependency upon
python-restclient which in turn had a dependency upon python-httplib2. I removed
these dependencies in favor of Python's urllib2, which is part of the Standard
Library. Since we're just doing basic HTTP GET calls, I felt that eliminating
the external dependencies made this library as lightweight as possible.
For REST API documentation please see "The OpenSSO REST Interface in Black/White"
http://blogs.sun.com/docteger/entry/opensso_and_rest
This is not a complete implementation. Only the end-user functionality has
been included. None of the administrative methods are implemented... yet.
Example:
>>> import opensso
>>> o = opensso.OpenSSO('https://example.com/opensso')
>>> token = o.authenticate('jathanism', 'password')
>>> o.is_token_valid(token)
True
>>> attrs = o.attributes(token)
>>> attrs.attributes.keys()
['telephonenumber', 'distinguishedname', 'inetUserStatus', 'displayname', 'cn',
'dn', 'samaccountname', 'useraccountcontrol', 'objectguid', 'userprincipalname',
'name', 'objectclass', 'sun-fm-saml2-nameid-info', 'sn', 'mail',
'sun-fm-saml2-nameid-infokey', 'givenname', 'employeenumber']
>>> attrs.attributes['displayname']
'McCollum, Jathan'
>>> o.logout(token)
>>> o.is_token_valid(token)
False
More details Soon(TM).