You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,11 @@ Add SAML support to your Python software using this library.
10
10
Forget those complicated libraries and use the open source library provided
11
11
and supported by OneLogin Inc.
12
12
13
-
This version supports Python3, There is a separate version that only support Python2: [python-saml](https://pypi.python.org/pypi/python-saml)
13
+
This version supports Python3, There is a separate version that only support Python2: [python-saml](https://pypi.python.org/pypi/python-saml)
14
14
15
15
#### Warning ####
16
16
17
-
Update python3-saml to 1.2.1 that patch 1.2.0 (that had a bug on signature validation process (when using wantAssertionsSigned and wantMessagesSigned).
17
+
Update python3-saml to 1.2.1 that patch 1.2.0 (that had a bug on signature validation process (when using wantAssertionsSigned and wantMessagesSigned).
18
18
19
19
1.2.0 version includes a security patch that contains extra validations that will prevent signature wrapping attacks.
20
20
@@ -80,7 +80,7 @@ Installation
80
80
81
81
* python 2.7 // python 3.3
82
82
*[xmlsec](https://pypi.python.org/pypi/xmlsec) Python bindings for the XML Security Library.
83
-
*[isodate](https://pypi.python.org/pypi/isodate) An ISO 8601 date/time/duration parser and formater
83
+
*[isodate](https://pypi.python.org/pypi/isodate) An ISO 8601 date/time/duration parser and formatter
84
84
85
85
Review the setup.py file to know the version of the library that python3-saml is using
86
86
@@ -93,7 +93,7 @@ The toolkit is hosted on github. You can download it from:
Copy the core of the library (src/onelogin/saml2 folder) and merge the setup.py inside the python application. (each application has its structure so take your time to locate the Python SAML toolkit in the best place).
96
+
Copy the core of the library (src/onelogin/saml2 folder) and merge the setup.py inside the python application. (each application has its structure so take your time to locate the Python SAML toolkit in the best place).
97
97
98
98
#### Option 2. Download from pypi ####
99
99
@@ -228,7 +228,7 @@ This is the settings.json file:
228
228
// attributeConsumingService. nameFormat, attributeValue and
229
229
// friendlyName can be ommited
230
230
"attributeConsumingService": {
231
-
"ServiceName":"SP test",
231
+
"serviceName":"SP test",
232
232
"serviceDescription":"Test Service",
233
233
"requestedAttributes": [
234
234
{
@@ -289,8 +289,8 @@ This is the settings.json file:
289
289
* Notice that if you want to validate any SAML Message sent by the HTTP-Redirect binding, you
290
290
* will need to provide the whole x509cert.
291
291
*/
292
-
//'certFingerprint' => '',
293
-
//'certFingerprintAlgorithm' => 'sha1',
292
+
//"certFingerprint" => "",
293
+
//"certFingerprintAlgorithm" => "sha1",
294
294
}
295
295
}
296
296
```
@@ -340,7 +340,7 @@ In addition to the required settings data (idp, sp), extra settings can be defin
340
340
341
341
// Indicates a requirement for the <saml:Assertion>
342
342
// elements received by this SP to be encrypted.
343
-
'wantAssertionsEncrypted'=>false,
343
+
"wantAssertionsEncrypted":false,
344
344
345
345
// Indicates a requirement for the NameID element on the SAMLResponse
346
346
// received by this SP to be present.
@@ -357,24 +357,24 @@ In addition to the required settings data (idp, sp), extra settings can be defin
357
357
// Set to false and no AuthContext will be sent in the AuthNRequest,
358
358
// Set true or don't present thi parameter and you will get an AuthContext 'exact' 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'
359
359
// Set an array with the possible auth context values: array ('urn:oasis:names:tc:SAML:2.0:ac:classes:Password', 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509'),
360
-
'requestedAuthnContext':true,
360
+
"requestedAuthnContext":true,
361
361
// Allows the authn comparison parameter to be set, defaults to 'exact' if the setting is not present.
362
-
'requestedAuthnContextComparison':'exact',
362
+
"requestedAuthnContextComparison":"exact",
363
363
364
364
// In some environment you will need to set how long the published metadata of the Service Provider gonna be valid.
365
365
// is possible to not set the 2 following parameters (or set to null) and default values will be set (2 days, 1 week)
366
366
// Provide the desire TimeStamp, for example 2015-06-26T20:00:00Z
367
-
'metadataValidUntil':null,
367
+
"metadataValidUntil":null,
368
368
// Provide the desire Duration, for example PT518400S (6 days)
369
-
'metadataCacheDuration':null,
369
+
"metadataCacheDuration":null,
370
370
371
371
// Algorithm that the toolkit will use on signing process. Options:
You can declare the settings_data in the file that constains the constructor execution or locate them in any file and load the file in order to get the dict available as we see in the following example:
429
+
You can declare the settings_data in the file that contains the constructor execution or locate them in any file and load the file in order to get the dict available as we see in the following example:
430
430
431
431
```python
432
432
filename ="/var/www/django-project/custom_settings.json"# The custom_settings.json contains a
@@ -526,7 +526,7 @@ The login method can recieve 3 more optional parameters:
526
526
#### The SP Endpoints ####
527
527
528
528
Related to the SP there are 3 important endpoints: The metadata view, the ACS view and the SLS view.
529
-
The toolkit provides examples of those views in the demos, but lets see an example.
529
+
The toolkit provides examples of those views in the demos, but let's see an example.
530
530
531
531
***SP Metadata***
532
532
@@ -583,7 +583,7 @@ The SAML response is processed and then checked that there are no errors. It als
583
583
At that point there are 2 possible alternatives:
584
584
585
585
* If no RelayState is provided, we could show the user data in this view or however we wanted.
586
-
* If RelayState is provided, a rediretion take place.
586
+
* If RelayState is provided, a redirection takes place.
587
587
588
588
Notice that we saved the user data in the session before the redirection to have the user data available at the RelayState view.
589
589
@@ -878,7 +878,7 @@ A class that contains functionality related to the metadata of the SP
878
878
879
879
****builder*** Generates the metadata of the SP based on the settings.
880
880
****sign_metadata*** Signs the metadata with the key/cert provided.
881
-
****add_x509_key_descriptors*** Adds the x509 descriptors (sign/encriptation) to the metadata
881
+
****add_x509_key_descriptors*** Adds the x509 descriptors (sign/encryption) to the metadata
882
882
883
883
####OneLogin_Saml2_Utils - utils.py####
884
884
@@ -916,7 +916,7 @@ Auxiliary class that contains several methods
916
916
917
917
A class that contains methods to handle XMLs
918
918
919
-
****to_string*** Serialize an element to an encoded string representation of its XML tree.
919
+
****to_string*** Serialize an element to an encoded string representation of its XML tree.
920
920
****to_etree*** Parses an XML document or fragment from a string.
921
921
****validate_xml*** Validates a xml against a schema
922
922
****query*** Extracts nodes that match the query from the Element
@@ -930,7 +930,7 @@ A class that contains methods to obtain and parse metadata from IdP
930
930
****parse_remote*** Get the metadata XML from the provided URL and parse it, returning a dict with extracted data
931
931
****parse*** Parse the Identity Provider metadata and returns a dict with extracted data
932
932
****merge_settings*** Will update the settings with the provided new settings data extracted from the IdP metadata
933
-
933
+
934
934
935
935
For more info, look at the source code; each method is documented and details about what does and how to use it are provided. Make sure to also check the doc folder where HTML documentation about the classes and methods is provided.
936
936
@@ -945,8 +945,8 @@ how it deployed. New demos using other python frameworks are welcome as a contri
945
945
946
946
### Getting Started ###
947
947
948
-
We said that this toolkit includes a django application demo and a flask applicacion demo,
949
-
lets see how fast is deploy them.
948
+
We said that this toolkit includes a django application demo and a flask application demo,
949
+
let's see how fast is it to deploy them.
950
950
951
951
***Virtualenv***
952
952
@@ -1011,7 +1011,7 @@ The Onelogin's Python Toolkit allows you to provide the settings info in 2 ways:
1011
1011
1012
1012
In the index.py file we define the app.config['SAML_PATH'], that will target to the 'saml' folder. We require it in order to load the settings files.
1013
1013
1014
-
First we need to edit the saml/settings.json, configure the SP part and review the metadata of the IdP and complete the IdP info. Later edit the saml/advanced_settings.json files and configure the how the toolkit will work. Check the settings section of this document if you have any doubt.
1014
+
First we need to edit the saml/settings.json, configure the SP part and review the metadata of the IdP and complete the IdP info. Later edit the saml/advanced_settings.json files and configure the how the toolkit will work. Check the settings section of this document if you have any doubt.
1015
1015
1016
1016
####IdP setup####
1017
1017
@@ -1037,14 +1037,14 @@ Once the SP is configured, the metadata of the SP is published at the /metadata
1037
1037
1038
1038
5.2 SLO Initiated by IdP. In this case, the action takes place on the IdP side, the logout process is initiated at the IdP, sends a Logout Request to the SP (SLS endpoint, /?sls). The SLS endpoint of the SP process the Logout Request and if is valid, close the session of the user at the local app and send a Logout Response to the IdP (to the SLS endpoint of the IdP). The IdP receives the Logout Response, process it and close the session at of the IdP. Notice that the SLO Workflow starts and ends at the IdP.
1039
1039
1040
-
Notice that all the SAML Requests and Responses are handled at a unique view (index) and how GET paramters are used to know the action that must be done.
1040
+
Notice that all the SAML Requests and Responses are handled at a unique view (index) and how GET parameters are used to know the action that must be done.
1041
1041
1042
1042
### Demo Django ###
1043
1043
1044
1044
You'll need a virtualenv with the toolkit installed on it.
1045
1045
1046
1046
To run the demo you need to install the requirements first. Load your
1047
-
virtualenv and execute:
1047
+
virtualenv and execute:
1048
1048
```
1049
1049
pip install -r demo-django/requirements.txt
1050
1050
```
@@ -1084,7 +1084,7 @@ The Onelogin's Python Toolkit allows you to provide the settings info in 2 ways:
1084
1084
1085
1085
After set the SAML_FOLDER in the demo/settings.py, the settings of the python toolkit will be loaded on the django web.
1086
1086
1087
-
First we need to edit the saml/settings.json, configure the SP part and review the metadata of the IdP and complete the IdP info. Later edit the saml/advanced_settings.json files and configure the how the toolkit will work. Check the settings section of this document if you have any doubt.
1087
+
First we need to edit the saml/settings.json, configure the SP part and review the metadata of the IdP and complete the IdP info. Later edit the saml/advanced_settings.json files and configure the how the toolkit will work. Check the settings section of this document if you have any doubt.
1088
1088
1089
1089
####IdP setup####
1090
1090
@@ -1096,7 +1096,7 @@ This demo works very similar to the flask-demo (We did it intentionally).
1096
1096
1097
1097
###Getting up and running on Heroku###
1098
1098
1099
-
Getting python3-saml up and running on Heroku will require some extra legwork: python3-saml depends on python-xmlsec which depends on headers from the xmlsec1-dev linux package to install correctly.
1099
+
Getting python3-saml up and running on Heroku will require some extra legwork: python3-saml depends on python-xmlsec which depends on headers from the xmlsec1-dev linux package to install correctly.
1100
1100
1101
1101
First you will need to add the ```apt``` buildpack to your build server:
0 commit comments