Skip to content

Commit 4d93801

Browse files
committed
docs(saml): describe lxml/xmlsec1 issues
1 parent 34313db commit 4d93801

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

docs/backends/saml.rst

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,21 @@ of those two universities can use their campus login to access your app.
1313
Required Dependency
1414
-------------------
1515

16-
You must install python-saml_ 2.2.0 or higher in order to use this
17-
backend, if using Python 3, you need to install python3-saml_ 1.2.1 or
18-
higher.
16+
You need to install python3-saml_, this is included in the ``saml`` extra when
17+
installing ``socil-core``.
18+
19+
In case you run into ``lxml & xmlsec libxml2 library version mismatch`` error,
20+
it is caused by ``lxml`` being built against a different version of ``libxml2``
21+
than ``xmlsec``. To avoid this, please install both packages from the source
22+
and build them against system libraries:
23+
24+
.. code-block:: sh
25+
26+
# Install system dependencies
27+
sudo apt install libxmlsec1-dev
28+
29+
# Install Python packages from the source
30+
pip install --no-binary lxml --no-binary xmlsec -e 'social-core[saml]'
1931
2032
Required Configuration
2133
----------------------
@@ -187,7 +199,7 @@ Advanced Settings
187199
- ``SOCIAL_AUTH_SAML_EXTRA_DATA``: This can be set to a list of tuples similar
188200
to the OAuth backend setting. It maps IDP attributes to extra_data attributes.
189201
Each attribute will be a list of values (even if only 1 value) per how
190-
python-saml_ processes attributes::
202+
python3-saml_ processes attributes::
191203

192204
SOCIAL_AUTH_SAML_EXTRA_DATA = [('attribute_name', 'extra_data_name_for_attribute'),
193205
('department', 'department'),
@@ -213,7 +225,6 @@ particular, there are two methods that are designed for subclasses to override:
213225
inspecting the passed attributes parameter, do nothing to allow the user to
214226
login, or raise ``social_core.exceptions.AuthForbidden`` to reject the user.
215227

216-
.. _python-saml: https://github.com/onelogin/python-saml
217228
.. _python3-saml: https://github.com/onelogin/python3-saml
218229
.. _TestShib: https://www.testshib.org/
219230
.. _metadata: https://www.testshib.org/metadata/testshib-providers.xml

0 commit comments

Comments
 (0)