@@ -143,6 +143,7 @@ Use the following setting to choose your preferred binding for SP initiated sso
143
143
144
144
For example::
145
145
146
+ import saml2
146
147
SAML_DEFAULT_BINDING = saml2.BINDING_HTTP_POST
147
148
148
149
Preferred Logout binding
@@ -165,12 +166,6 @@ Use the following setting to ignore these errors and perform a local Django logo
165
166
166
167
SAML_IGNORE_LOGOUT_ERRORS = True
167
168
168
- Signed Logout Request
169
- =====================
170
-
171
- Idp's like Okta require a signed logout response to validate and logout a user. Here's a sample config with all required SP/IDP settings::
172
-
173
- "logout_requests_signed": True,
174
169
175
170
Discovery Service
176
171
=================
@@ -377,6 +372,7 @@ settings.py file under the SAML_CONFIG option. We will see a typical configurati
377
372
import saml2
378
373
import saml2.saml
379
374
BASEDIR = path.dirname(path.abspath(__file__))
375
+
380
376
SAML_CONFIG = {
381
377
# full path to the xmlsec1 binary programm
382
378
'xmlsec_binary': '/usr/bin/xmlsec1',
@@ -422,7 +418,9 @@ settings.py file under the SAML_CONFIG option. We will see a typical configurati
422
418
'name_id_format_allow_create': False,
423
419
424
420
# attributes that this project need to identify a user
425
- 'required_attributes': ['uid'],
421
+ 'required_attributes': ['givenName',
422
+ 'sn',
423
+ 'mail'],
426
424
427
425
# attributes that may be useful to have but not required
428
426
'optional_attributes': ['eduPersonAffiliation'],
@@ -498,18 +496,32 @@ settings.py file under the SAML_CONFIG option. We will see a typical configurati
498
496
499
497
.. _`PySAML2 documentation` : http://pysaml2.readthedocs.io/en/latest/
500
498
499
+
501
500
There are several external files and directories you have to create according
502
501
to this configuration.
503
502
504
503
The xmlsec1 binary was mentioned in the installation section. Here, in the
505
504
configuration part you just need to put the full path to xmlsec1 so PySAML2
506
505
can call it as it needs.
507
506
507
+ Signed Logout Request
508
+ =====================
509
+
510
+ Idp's like Okta require a signed logout response to validate and logout a user. Here's a sample config with all required SP/IDP settings::
511
+
512
+ "logout_requests_signed": True,
513
+
514
+ Attribute Map
515
+ =============
516
+
508
517
The ``attribute_map_dir `` points to a directory with attribute mappings that
509
518
are used to translate user attribute names from several standards. It's usually
510
519
safe to just copy the default PySAML2 attribute maps that you can find in the
511
520
``tests/attributemaps `` directory of the source distribution.
512
521
522
+ Metadata
523
+ ========
524
+
513
525
The ``metadata `` option is a dictionary where you can define several types of
514
526
metadata for remote entities. Usually the easiest type is the ``local `` where
515
527
you just put the name of a local XML file with the contents of the remote
@@ -520,6 +532,10 @@ entities metadata. This XML file should be in the SAML2 metadata format.
520
532
Don't use ``remote `` option for fetching metadata in production.
521
533
Try to use ``mdq `` and introduce a MDQ server instead, it's more efficient.
522
534
535
+
536
+ Certificates
537
+ ============
538
+
523
539
The ``key_file `` and ``cert_file `` options reference the two parts of a
524
540
standard x509 certificate. You need it to sign your metadata. For assertion
525
541
encryption/decryption support please configure another set of ``key_file `` and
@@ -529,7 +545,6 @@ encryption/decryption support please configure another set of ``key_file`` and
529
545
530
546
Check your openssl documentation to generate a certificate suitable for SAML2 operations.
531
547
532
-
533
548
SAML2 certificate creation example::
534
549
535
550
openssl req -nodes -new -x509 -newkey rsa:2048 -days 3650 -keyout private.key -out public.cert
0 commit comments