@@ -4,7 +4,7 @@ An extremly simple example of a SAML2 service provider.
4
4
=======================================================
5
5
6
6
How it works
7
- ------------
7
+ ************
8
8
9
9
A SP works with authentication and possibly attribute aggregation.
10
10
Both of these functions can be seen as parts of the normal Repoze.who
@@ -26,35 +26,52 @@ from the IdP/AA. If there exists both a name and a friendly name, for
26
26
instance, the friendly name is used as the key.
27
27
28
28
Setup
29
- -----
29
+ *****
30
30
31
- If you look in the example/sp directory of the distribution you will see
32
- the necessary files:
31
+ **sp-wsgi: **
32
+
33
+ * Go to the folder:
34
+ [your path]/pysaml2/example/sp-wsgi
35
+
36
+ * Take the file named sp_conf.py.example and rename it sp_conf.py
37
+
38
+ sp_conf.py is configured to run on localhost on port 8087. If you want to you could make the necessary changes before proceeding to the next step.
39
+
40
+ * In order to generate the metadata file open a terminal::
41
+
42
+ cd [your path]/pysaml2/example/sp-wsgi
43
+ make_metadata.py sp_conf.py > sp.xml
44
+
45
+
46
+ **sp-repoze: **
47
+
48
+ * Go to the folder:
49
+ [your path]/pysaml2/example/sp-repoze
50
+
51
+ * Take the file named sp_conf.py.example and rename it sp_conf.py
52
+
53
+ sp_conf.py is configured to run on localhost on port 8087. If you want to you could make the necessary changes before proceeding to the next step.
54
+
55
+ * In order to generate the metadata file open a terminal::
56
+
57
+ cd [your path]/pysaml2/example/sp-repoze
58
+ make_metadata.py sp_conf.py > sp.xml
59
+
60
+ Important files:
33
61
34
- application.py
35
- which is the web application. In this case it will just print the
36
- information provided by the IdP in a table.
37
-
38
62
sp_conf.py
39
63
The SPs configuration
40
64
41
65
who.ini
42
66
The repoze.who configuration file
43
67
44
- And then there are two files with certificates, mykey.pem with the private
68
+ Inside the folder named pki there are two files with certificates, mykey.pem with the private
45
69
certificate and mycert.pem with the public part.
46
70
47
71
I'll go through these step by step.
48
72
49
- The application
50
- ---------------
51
-
52
- Build to use the wsgiref's simple_server, which is fine for testing but
53
- not for production.
54
-
55
-
56
- SP configuration
57
- ----------------
73
+ sp_conf.py
74
+ ----------
58
75
59
76
The configuration is written as described in :ref: `howto_config `. It means among other
60
77
things that it's easily testable as to the correct syntax.
@@ -134,8 +151,9 @@ Change directory to where you have the configuration file and do ::
134
151
135
152
136
153
137
- Repoze configuration
138
- --------------------
154
+ who.ini
155
+ -------
156
+ The file named who.ini is the repoze.who configuration file
139
157
140
158
I'm not going through the INI file format here. You should read
141
159
`Middleware Responsibilities <http://docs.repoze.org/who/2.0/middleware.html >`_
@@ -175,6 +193,23 @@ After this, the plugin is referenced in a couple of places::
175
193
176
194
Which means that the plugin is used in all phases.
177
195
196
+ Run SP:
197
+ *******
198
+
199
+ Open a Terminal::
200
+
201
+ cd [your path]/pysaml2/example/sp-wsgi
202
+ python sp.py sp_conf
203
+
204
+ Note that you should not have the .py extension on the sp_conf.py while running the program
205
+
206
+ Now you should be able to open a web browser go to to service provider (if you didn't change sp_conf.py it should be: http://localhost:8087)
207
+
208
+ You should be redirected to the IDP and presented with a login screen.
209
+
210
+ You could enter Username:roland and Password: dianakra
211
+ All users are specified in idp.py in a dictionary named PASSWD
212
+
178
213
The application
179
214
---------------
180
215
0 commit comments