Skip to content

Commit da2319d

Browse files
committed
RTD setup section and pysaml2 example
1 parent ad604e7 commit da2319d

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

docs/source/contents/setup.rst

+23-8
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ Use the following setting to choose your preferred binding for SP initiated sso
143143

144144
For example::
145145

146+
import saml2
146147
SAML_DEFAULT_BINDING = saml2.BINDING_HTTP_POST
147148

148149
Preferred Logout binding
@@ -165,12 +166,6 @@ Use the following setting to ignore these errors and perform a local Django logo
165166

166167
SAML_IGNORE_LOGOUT_ERRORS = True
167168

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,
174169

175170
Discovery Service
176171
=================
@@ -377,6 +372,7 @@ settings.py file under the SAML_CONFIG option. We will see a typical configurati
377372
import saml2
378373
import saml2.saml
379374
BASEDIR = path.dirname(path.abspath(__file__))
375+
380376
SAML_CONFIG = {
381377
# full path to the xmlsec1 binary programm
382378
'xmlsec_binary': '/usr/bin/xmlsec1',
@@ -422,7 +418,9 @@ settings.py file under the SAML_CONFIG option. We will see a typical configurati
422418
'name_id_format_allow_create': False,
423419

424420
# attributes that this project need to identify a user
425-
'required_attributes': ['uid'],
421+
'required_attributes': ['givenName',
422+
'sn',
423+
'mail'],
426424

427425
# attributes that may be useful to have but not required
428426
'optional_attributes': ['eduPersonAffiliation'],
@@ -498,18 +496,32 @@ settings.py file under the SAML_CONFIG option. We will see a typical configurati
498496

499497
.. _`PySAML2 documentation`: http://pysaml2.readthedocs.io/en/latest/
500498

499+
501500
There are several external files and directories you have to create according
502501
to this configuration.
503502

504503
The xmlsec1 binary was mentioned in the installation section. Here, in the
505504
configuration part you just need to put the full path to xmlsec1 so PySAML2
506505
can call it as it needs.
507506

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+
508517
The ``attribute_map_dir`` points to a directory with attribute mappings that
509518
are used to translate user attribute names from several standards. It's usually
510519
safe to just copy the default PySAML2 attribute maps that you can find in the
511520
``tests/attributemaps`` directory of the source distribution.
512521

522+
Metadata
523+
========
524+
513525
The ``metadata`` option is a dictionary where you can define several types of
514526
metadata for remote entities. Usually the easiest type is the ``local`` where
515527
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.
520532
Don't use ``remote`` option for fetching metadata in production.
521533
Try to use ``mdq`` and introduce a MDQ server instead, it's more efficient.
522534

535+
536+
Certificates
537+
============
538+
523539
The ``key_file`` and ``cert_file`` options reference the two parts of a
524540
standard x509 certificate. You need it to sign your metadata. For assertion
525541
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
529545

530546
Check your openssl documentation to generate a certificate suitable for SAML2 operations.
531547

532-
533548
SAML2 certificate creation example::
534549

535550
openssl req -nodes -new -x509 -newkey rsa:2048 -days 3650 -keyout private.key -out public.cert

0 commit comments

Comments
 (0)