@@ -132,14 +132,14 @@ RELATE_MAINTENANCE_MODE = False
132
132
# May be set to a string to set a sitewide announcement visible on every page.
133
133
RELATE_SITE_ANNOUNCEMENT = None
134
134
135
+ # }}}
136
+
135
137
# Uncomment this to enable i18n, change 'en-us' to locale name your language.
136
138
# Make sure you have generated, translate and compile the message file of your
137
139
# language. If commented, RELATE will use default language 'en-us'.
138
140
139
141
#LANGUAGE_CODE='en-us'
140
142
141
- # }}}
142
-
143
143
# {{{ exams and testing
144
144
145
145
RELATE_FACILITIES = {
@@ -157,4 +157,118 @@ RELATE_TICKET_MINUTES_VALID_AFTER_USE = 12*60
157
157
158
158
# }}}
159
159
160
+ # {{{ saml2 (optional)
161
+
162
+ if RELATE_SIGN_IN_BY_SAML2_ENABLED :
163
+ from os import path
164
+ import saml2 .saml
165
+ _BASEDIR = path .dirname (path .abspath (__file__ ))
166
+
167
+ _BASE_URL = 'https://relate.cs.illinois.edu'
168
+
169
+ SAML_CONFIG = {
170
+ # full path to the xmlsec1 binary programm
171
+ 'xmlsec_binary' : '/usr/bin/xmlsec1' ,
172
+
173
+ # your entity id, usually your subdomain plus the url to the metadata view
174
+ # (usually no need to change)
175
+ 'entityid' : _BASE_URL + '/saml2/metadata/' ,
176
+
177
+ # directory with attribute mapping
178
+ # (already populated with samples from djangosaml2, usually no need to
179
+ # change)
180
+ 'attribute_map_dir' : path .join (_BASEDIR , 'saml-config' , 'attribute-maps' ),
181
+
182
+ # this block states what services we provide
183
+ 'service' : {
184
+ 'sp' : {
185
+ 'name' : 'RELATE SAML2 SP' ,
186
+ 'name_id_format' : saml2 .saml .NAMEID_FORMAT_PERSISTENT ,
187
+ 'endpoints' : {
188
+ # url and binding to the assertion consumer service view
189
+ # do not change the binding or service name
190
+ 'assertion_consumer_service' : [
191
+ (_BASE_URL + '/saml2/acs/' ,
192
+ saml2 .BINDING_HTTP_POST ),
193
+ ],
194
+ # url and binding to the single logout service view
195
+ # do not change the binding or service name
196
+ 'single_logout_service' : [
197
+ (_BASE_URL + '/saml2/ls/' ,
198
+ saml2 .BINDING_HTTP_REDIRECT ),
199
+ (_BASE_URL + '/saml2/ls/post' ,
200
+ saml2 .BINDING_HTTP_POST ),
201
+ ],
202
+ },
203
+
204
+ # attributes that this project needs to identify a user
205
+ 'required_attributes' : ['uid' ],
206
+
207
+ # attributes that may be useful to have but not required
208
+ 'optional_attributes' : ['eduPersonAffiliation' ],
209
+
210
+ # in this section the list of IdPs we talk to are defined
211
+ 'idp' : {
212
+ # Find the entity ID of your IdP and make this the key here:
213
+ 'urn:mace:incommon:uiuc.edu' : {
214
+ 'single_sign_on_service' : {
215
+ # Add the POST and REDIRECT bindings for the sign on service here:
216
+ saml2 .BINDING_HTTP_POST :
217
+ 'https://shibboleth.illinois.edu/idp/profile/SAML2/POST/SSO' ,
218
+ saml2 .BINDING_HTTP_REDIRECT :
219
+ 'https://shibboleth.illinois.edu/idp/profile/SAML2/Redirect/SSO' ,
220
+ },
221
+ 'single_logout_service' : {
222
+ # And the REDIRECT binding for the logout service here:
223
+ saml2 .BINDING_HTTP_REDIRECT :
224
+ 'https://shibboleth.illinois.edu/idp/logout.jsp' , # noqa
225
+ },
226
+ },
227
+ },
228
+ },
229
+ },
230
+
231
+ # You will get this XML file from your institution. It has finite validity
232
+ # and will need to be re-downloaded periodically.
233
+ #
234
+ # "itrust" is an example name that's valid for the University of Illinois.
235
+ # This particular file is public and lives at
236
+ # https://discovery.itrust.illinois.edu/itrust-metadata/itrust-metadata.xml
237
+
238
+ 'metadata' : {
239
+ 'local' : [path .join (_BASEDIR , 'saml-config' , 'itrust-metadata.xml' )],
240
+ },
241
+
242
+ # set to 1 to output debugging information
243
+ 'debug' : 1 ,
244
+
245
+ # certificate
246
+ # see saml2-keygen.sh in this directory
247
+ 'key_file' : path .join (_BASEDIR , 'saml-config' , 'sp-key.pem' ), # private part
248
+ 'cert_file' : path .join (_BASEDIR , 'saml-config' , 'sp-cert.pem' ), # public part
249
+
250
+ # own metadata settings
251
+ 'contact_person' : [
252
+ {'given_name' : 'Andreas' ,
253
+ 'sur_name' : 'Kloeckner' ,
254
+ 'company' : 'CS - University of Illinois' ,
255
+ 'email_address' :
'[email protected] ' ,
256
+ 'contact_type' : 'technical' },
257
+ {'given_name' : 'Andreas' ,
258
+ 'sur_name' : 'Kloeckner' ,
259
+ 'company' : 'CS - University of Illinois' ,
260
+ 'email_address' :
'[email protected] ' ,
261
+ 'contact_type' : 'administrative' },
262
+ ],
263
+ # you can set multilanguage information here
264
+ 'organization' : {
265
+ 'name' : [('RELATE' , 'en' )],
266
+ 'display_name' : [('RELATE' , 'en' )],
267
+ 'url' : [(_BASE_URL , 'en' )],
268
+ },
269
+ 'valid_for' : 24 , # how long is our metadata valid
270
+ }
271
+
272
+ # }}}
273
+
160
274
# vim: filetype=python:foldmethod=marker
0 commit comments