Added description of files that should be part of the package
[freeradius-pysaml2.git] / README
1 moonshot
2 ========
3 A python module usable in a Moonshot environment to allow a freeradius server
4 to fetch information about a user from a SAML2 Attribute Authority (AA) or
5 Identity Provider (IdP).
6 There are some things you have to do disregarding how you want the SP to
7 talk to the IdP/AA. So I take those first.
8
9 Dependency
10 ----------
11
12 This package is dependent on pySAML2.
13 You should get PySAML2 from Launchpad, the version that is at PyPI is not
14 enough up-to-date.
15
16 bzr co bzr+ssh://bazaar.launchpad.net/%2Bbranch/pysaml2/
17
18 should get you the latest version.
19
20 Basic Installing
21 ----------
22
23 A couple of changes to the freeradius configuration are necessary.
24 This is one way of doing it. How you chose to do it depends on your local
25 preferences.
26
27 1) create raddb/modules/python
28
29 You can use one of the provided 'template/modules_python_aa' or
30 'template/modules_python_ecp' files as they are. Which one depends of your
31 choice of using ECP or AA. Rename of copy the one you want to use to
32 'template/modules_python' and copy it to raddb/modules.
33
34 Regarding the configuration of outer/inner tunnel this is still a bit
35 undecided. The extension module can be use in either.
36
37 2) Edit raddb/sites-available/default
38 To the 'post-auth' section add one line referencing the python module.
39 You can see how it can be done in
40 'template/sites-available_default".
41
42 3) Edit raddb/sites-available/inner-tunnel.
43 To the 'post-auth' section add one line referencing the python module.
44 You can see how it can be done in
45 'template/sites-available_inner-tunnel".
46
47
48 Now, you should have the basic freeradius setup.
49 To get it working you have to do a couple of more things:
50
51
52 I) Get the SAML2 metadata for the AA or IDP you want to use. Rename it to
53 metadata.xml and place it in the 'etc' directory.
54
55
56 II) Chose one of the configuration files for the extension you want to use.
57 There are two choices (etc/aa_config.py and etc/ecp_config.py).
58 Rename (or copy) the one you want to use to config.py and edit it.
59
60 You must change the value of ATTRIBUTE_AUTHORITY/IDP_ENTITYID so it is the
61 identifier (entityID) of the SAML2 AA/IdP you want to use.
62
63
64 III) Change the pysaml2 configuration file 'etc/pysaml_config.py'.
65 A couple of things:
66
67 BASE : This is the identifier of the SP (=this module) you are running.
68
69 organization: Information about the organization running this service
70
71 contact_person: Information about a person people can contact to ask about
72     this service
73
74 xmlsec_binary: where the xmlsec1 binaries are located. This is only needed if
75 these binaries are somewhere outside the normal PATH.
76
77 IV) Create your own key pair.
78
79 A key and certificate can be created using the openssl tool:
80 $ openssl genrsa 1024 > ssl.key
81 $ openssl req -new -x509 -nodes -sha1 -days 365 -key ssl.key > ssl.cert
82 $ sudo mv ssl.key ssl.cert /usr/local/etc/moonshot/pki
83
84 If you chose other names for you key and cert you have to change
85 pysaml_config.py accordingly.
86
87
88 V)
89
90 Now you can install the package:
91
92 python setup.py install
93
94 should place everything in it's place.
95 One thing that might happen is that a new directory is created.
96 /usr/local/etc/moonshot
97 You may have to change the premissions on this directory to make it possible
98 for the freeradius extension to access the information in the directory.
99
100 VI) Create the metadata file for your SP.
101
102 $ cd etc
103 $ make_metadata.py pysaml_config.py > sp.xml
104
105 This file you have to give to the person/organization that runs the AA/IdP you
106 want to get information from.
107
108 !!! That should be it !!!
109