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
****check_sp_certs*** Checks if the x509 certs of the SP exists and are valid.
753
+
****get_sp_key*** Returns the x509 private key of the SP.
754
+
****get_sp_cert*** Returns the x509 public cert of the SP.
755
+
****get_idp_cert*** Returns the x509 public cert of the IdP.
756
+
****get_sp_data*** Gets the SP data.
757
+
****get_idp_data*** Gets the IdP data.
758
+
****get_security_data*** Gets security data.
759
+
****get_contacts*** Gets contacts data.
760
+
****get_organization*** Gets organization data.
761
+
****format_idp_cert*** Formats the IdP cert.
762
+
****format_sp_cert*** Formats the SP cert.
763
+
****format_sp_key*** Formats the private key.
764
+
****set_strict*** Activates or deactivates the strict mode.
765
+
****is_strict*** Returns if the 'strict' mode is active.
766
+
****is_debug_active*** Returns if the debug is active.
767
+
768
+
####OneLogin_Saml2_Metadata - metadata.py####
769
+
770
+
A class that contains functionality related to the metadata of the SP
771
+
772
+
****builder*** Generates the metadata of the SP based on the settings.
773
+
****sign_metadata*** Signs the metadata with the key/cert provided.
774
+
****add_x509_key_descriptors*** Adds the x509 descriptors (sign/encriptation) to the metadata
775
+
776
+
####OneLogin_Saml2_Utils - utils.py####
777
+
778
+
Auxiliary class that contains several methods
779
+
780
+
****decode_base64_and_inflate*** Base64 decodes and then inflates according to RFC1951.
781
+
****deflate_and_base64_encode*** Deflates and the base64 encodes a string.
782
+
****validate_xml*** Validates a xml against a schema.
783
+
****format_cert*** Returns a x509 cert (adding header & footer if required).
784
+
****format_private_key*** Returns a private key (adding header & footer if required).
785
+
****redirect*** Executes a redirection to the provided url (or return the target url).
786
+
****get_self_url_host*** Returns the protocol + the current host + the port (if different than common ports).
787
+
****get_self_host*** Returns the current host.
788
+
****is_https*** Checks if https or http.
789
+
****get_self_url_no_query*** Returns the URL of the current host + current view.
790
+
****get_self_routed_url_no_query*** Returns the routed URL of the current host + current view.
791
+
****get_self_url*** Returns the URL of the current host + current view + query.
792
+
****generate_unique_id*** Generates an unique string (used for example as ID for assertions).
793
+
****parse_time_to_SAML*** Converts a UNIX timestamp to SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z.
794
+
****parse_SAML_to_time*** Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z to a UNIX timestamp.
795
+
****now*** Returns unix timestamp of actual time.
796
+
****parse_duration*** Interprets a ISO8601 duration value relative to a given timestamp.
797
+
****get_expire_time*** Compares 2 dates and returns the earliest.
798
+
****query*** Extracts nodes that match the query from the Element.
799
+
****delete_local_session*** Deletes the local session.
800
+
****calculate_x509_fingerprint*** Calculates the fingerprint of a x509cert.
801
+
****format_finger_print*** Formates a fingerprint.
802
+
****generate_name_id*** Generates a nameID.
803
+
****get_status*** Gets Status from a Response.
804
+
****decrypt_element*** Decrypts an encrypted element.
805
+
****write_temp_file*** Writes some content into a temporary file and returns it.
806
+
****add_sign*** Adds signature key and senders certificate to an element (Message or Assertion).
807
+
****validate_sign*** Validates a signature (Message or Assertion).
808
+
****validate_binary_sign*** Validates signed bynary data (Used to validate GET Signature).
809
+
810
+
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.
811
+
812
+
Demos included in the toolkit
813
+
-----------------------------
814
+
815
+
The toolkit includes 2 demos to teach how use the toolkit (A django and a flask project), take a look on it.
816
+
Demos require that SP and IdP are well configured before test it, so edit the settings files.
817
+
818
+
Notice that each python framework has it own way to handle routes/urls and process request, so focus on
819
+
how it deployed. New demos using other python frameworks are welcome as a contribution.
666
820
667
821
### Getting Started ###
668
822
@@ -692,7 +846,7 @@ If you want install it in a nomal mode, execute:
692
846
python setup.py install
693
847
```
694
848
695
-
####Demo Flask####
849
+
### Demo Flask ###
696
850
697
851
You'll need a virtualenv with the toolkit installed on it.
698
852
@@ -714,7 +868,14 @@ Now, with the virtualenv loaded, you can run the demo like this:
714
868
715
869
You'll have the demo running at http://localhost:8000
716
870
717
-
#### Demo Django ####
871
+
####Content####
872
+
873
+
874
+
####How it works####
875
+
876
+
877
+
878
+
### Demo Django ###
718
879
719
880
You'll need a virtualenv with the toolkit installed on it.
720
881
@@ -734,32 +895,8 @@ Now, with the virtualenv loaded, you can run the demo like this:
734
895
735
896
You'll have the demo running at http://localhost:8000
736
897
737
-
#### Tests Suite ####
738
-
739
-
To run the test you only need to load the virtualenv with the toolkit installed
740
-
on it and execute:
741
-
```
742
-
python setup.py test
743
-
```
744
-
745
-
The previous line will run the tests for the whole toolkit. You can also run
746
-
the tests for a specific module. To do so for the `auth` module you would
747
-
have to execute this:
748
-
```
749
-
python setup.py test --test-suite tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test
750
-
```
751
-
752
-
With the `--test-suite` parameter you can specify the module to test. You'll
753
-
find all the module available and their class names at
0 commit comments