File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed
Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "strict" : false ,
3+ "debug" : false ,
4+ "custom_base_path" : " ../../../tests/data/customPath/" ,
5+ "sp" : {
6+ "entityId" : " http://stuff.com/endpoints/metadata.php" ,
7+ "assertionConsumerService" : {
8+ "url" : " http://stuff.com/endpoints/endpoints/acs.php"
9+ },
10+ "singleLogoutService" : {
11+ "url" : " http://stuff.com/endpoints/endpoints/sls.php"
12+ },
13+ "NameIDFormat" : " urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
14+ },
15+ "idp" : {
16+ "entityId" : " http://idp.example.com/" ,
17+ "singleSignOnService" : {
18+ "url" : " http://idp.example.com/SSOService.php"
19+ },
20+ "singleLogoutService" : {
21+ "url" : " http://idp.example.com/SingleLogoutService.php"
22+ }
23+ },
24+ "security" : {
25+ "authnRequestsSigned" : false ,
26+ "wantAssertionsSigned" : false ,
27+ "signMetadata" : false
28+ },
29+ "contactPerson" : {
30+ "technical" : {
31+ "givenName" : " technical_name" ,
32+ "emailAddress" : " technical@example.com"
33+ },
34+ "support" : {
35+ "givenName" : " support_name" ,
36+ "emailAddress" : " support@example.com"
37+ }
38+ },
39+ "organization" : {
40+ "en-US" : {
41+ "name" : " sp_test" ,
42+ "displayname" : " SP test" ,
43+ "url" : " http://sp.example.com"
44+ }
45+ }
46+ }
Original file line number Diff line number Diff line change @@ -222,6 +222,28 @@ def testGetSPKey(self):
222222 settings_3 = OneLogin_Saml2_Settings (settings_data , custom_base_path = custom_base_path )
223223 self .assertIsNone (settings_3 .get_sp_key ())
224224
225+ def testGetIDPCert (self ):
226+ """
227+ Tests the get_idp_cert method of the OneLogin_Saml2_Settings
228+ """
229+
230+ settings = OneLogin_Saml2_Settings (self .loadSettingsJSON ('settings9.json' ))
231+ cert = "-----BEGIN CERTIFICATE-----\n MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMC\n Tk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYD\n VQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG\n 9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4\n MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xi\n ZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2Zl\n aWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5v\n MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LO\n NoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHIS\n KOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d\n 1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8\n BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7n\n bK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2Qar\n Q4/67OZfHd7R+POBXhophSMv1ZOo\n -----END CERTIFICATE-----\n "
232+ self .assertEqual (cert , settings .get_idp_cert ())
233+
234+ settings_data = self .loadSettingsJSON ()
235+
236+ settings = OneLogin_Saml2_Settings (settings_data )
237+ settings_data ['idp' ]['x509cert' ] = cert
238+ self .assertEqual (cert , settings .get_sp_cert ())
239+
240+ del settings_data ['idp' ]['x509cert' ]
241+ del settings_data ['custom_base_path' ]
242+ custom_base_path = dirname (__file__ )
243+
244+ settings_3 = OneLogin_Saml2_Settings (settings_data , custom_base_path = custom_base_path )
245+ self .assertIsNone (settings_3 .get_idp_cert ())
246+
225247 def testFormatIdPCert (self ):
226248 """
227249 Tests the format_idp_cert method of the OneLogin_Saml2_Settings
You can’t perform that action at this time.
0 commit comments