Skip to content

Commit e3ae70c

Browse files
authored
Merge pull request SAML-Toolkits#35 from quantus/master
Fix typos and json sample code in documentation
2 parents d71bc54 + f65a794 commit e3ae70c

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Add SAML support to your Python software using this library.
1010
Forget those complicated libraries and use the open source library provided
1111
and supported by OneLogin Inc.
1212

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)
1414

1515
#### Warning ####
1616

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).
1818

1919
1.2.0 version includes a security patch that contains extra validations that will prevent signature wrapping attacks.
2020

@@ -80,7 +80,7 @@ Installation
8080

8181
* python 2.7 // python 3.3
8282
* [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
8484

8585
Review the setup.py file to know the version of the library that python3-saml is using
8686

@@ -93,7 +93,7 @@ The toolkit is hosted on github. You can download it from:
9393
* Lastest release: https://github.com/onelogin/python3-saml/releases/latest
9494
* Master repo: https://github.com/onelogin/python3-saml/tree/master
9595

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).
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).
9797

9898
#### Option 2. Download from pypi ####
9999

@@ -228,7 +228,7 @@ This is the settings.json file:
228228
// attributeConsumingService. nameFormat, attributeValue and
229229
// friendlyName can be ommited
230230
"attributeConsumingService": {
231-
"ServiceName": "SP test",
231+
"serviceName": "SP test",
232232
"serviceDescription": "Test Service",
233233
"requestedAttributes": [
234234
{
@@ -289,8 +289,8 @@ This is the settings.json file:
289289
* Notice that if you want to validate any SAML Message sent by the HTTP-Redirect binding, you
290290
* will need to provide the whole x509cert.
291291
*/
292-
// 'certFingerprint' => '',
293-
// 'certFingerprintAlgorithm' => 'sha1',
292+
// "certFingerprint" => "",
293+
// "certFingerprintAlgorithm" => "sha1",
294294
}
295295
}
296296
```
@@ -340,7 +340,7 @@ In addition to the required settings data (idp, sp), extra settings can be defin
340340

341341
// Indicates a requirement for the <saml:Assertion>
342342
// elements received by this SP to be encrypted.
343-
'wantAssertionsEncrypted' => false,
343+
"wantAssertionsEncrypted": false,
344344

345345
// Indicates a requirement for the NameID element on the SAMLResponse
346346
// 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
357357
// Set to false and no AuthContext will be sent in the AuthNRequest,
358358
// 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'
359359
// 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,
361361
// Allows the authn comparison parameter to be set, defaults to 'exact' if the setting is not present.
362-
'requestedAuthnContextComparison': 'exact',
362+
"requestedAuthnContextComparison": "exact",
363363

364364
// In some environment you will need to set how long the published metadata of the Service Provider gonna be valid.
365365
// is possible to not set the 2 following parameters (or set to null) and default values will be set (2 days, 1 week)
366366
// Provide the desire TimeStamp, for example 2015-06-26T20:00:00Z
367-
'metadataValidUntil': null,
367+
"metadataValidUntil": null,
368368
// Provide the desire Duration, for example PT518400S (6 days)
369-
'metadataCacheDuration': null,
369+
"metadataCacheDuration": null,
370370

371371
// Algorithm that the toolkit will use on signing process. Options:
372372
// 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
373373
// 'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
374374
// 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
375375
// 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'
376376
// 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'
377-
'signatureAlgorithm': 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
377+
"signatureAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
378378
},
379379

380380
// Contact information template, it is recommended to suply a
@@ -426,7 +426,7 @@ auth = OneLogin_Saml2_Auth(req, settings_data)
426426
settings = OneLogin_Saml2_Settings(settings_data)
427427
```
428428

429-
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:
430430

431431
```python
432432
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:
526526
#### The SP Endpoints ####
527527

528528
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.
530530

531531
***SP Metadata***
532532

@@ -583,7 +583,7 @@ The SAML response is processed and then checked that there are no errors. It als
583583
At that point there are 2 possible alternatives:
584584

585585
* 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.
587587

588588
Notice that we saved the user data in the session before the redirection to have the user data available at the RelayState view.
589589

@@ -878,7 +878,7 @@ A class that contains functionality related to the metadata of the SP
878878

879879
* ***builder*** Generates the metadata of the SP based on the settings.
880880
* ***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
882882

883883
####OneLogin_Saml2_Utils - utils.py####
884884

@@ -916,7 +916,7 @@ Auxiliary class that contains several methods
916916

917917
A class that contains methods to handle XMLs
918918

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.
920920
* ***to_etree*** Parses an XML document or fragment from a string.
921921
* ***validate_xml*** Validates a xml against a schema
922922
* ***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
930930
* ***parse_remote*** Get the metadata XML from the provided URL and parse it, returning a dict with extracted data
931931
* ***parse*** Parse the Identity Provider metadata and returns a dict with extracted data
932932
* ***merge_settings*** Will update the settings with the provided new settings data extracted from the IdP metadata
933-
933+
934934

935935
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.
936936

@@ -945,8 +945,8 @@ how it deployed. New demos using other python frameworks are welcome as a contri
945945

946946
### Getting Started ###
947947

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.
950950

951951
***Virtualenv***
952952

@@ -1011,7 +1011,7 @@ The Onelogin's Python Toolkit allows you to provide the settings info in 2 ways:
10111011

10121012
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.
10131013

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.
10151015

10161016
####IdP setup####
10171017

@@ -1037,14 +1037,14 @@ Once the SP is configured, the metadata of the SP is published at the /metadata
10371037

10381038
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.
10391039

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.
10411041

10421042
### Demo Django ###
10431043

10441044
You'll need a virtualenv with the toolkit installed on it.
10451045

10461046
To run the demo you need to install the requirements first. Load your
1047-
virtualenv and execute:
1047+
virtualenv and execute:
10481048
```
10491049
pip install -r demo-django/requirements.txt
10501050
```
@@ -1084,7 +1084,7 @@ The Onelogin's Python Toolkit allows you to provide the settings info in 2 ways:
10841084

10851085
After set the SAML_FOLDER in the demo/settings.py, the settings of the python toolkit will be loaded on the django web.
10861086

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.
10881088

10891089
####IdP setup####
10901090

@@ -1096,7 +1096,7 @@ This demo works very similar to the flask-demo (We did it intentionally).
10961096

10971097
###Getting up and running on Heroku###
10981098

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.
11001100

11011101
First you will need to add the ```apt``` buildpack to your build server:
11021102

0 commit comments

Comments
 (0)