Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f3089e9e
Commit
f3089e9e
authored
Oct 19, 2016
by
Saleem Latif
Committed by
GitHub
Oct 19, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13783 from edx/saleem-latif/ENT-28
ENT-28: Add testing for 'saml' management command
parents
907801d6
38931957
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
931 additions
and
0 deletions
+931
-0
common/djangoapps/third_party_auth/management/commands/tests/test_data/another-testshib-providers.xml
+379
-0
common/djangoapps/third_party_auth/management/commands/tests/test_data/testshib-providers.xml
+379
-0
common/djangoapps/third_party_auth/management/commands/tests/test_saml.py
+135
-0
common/djangoapps/third_party_auth/tests/factories.py
+37
-0
openedx/core/djangoapps/site_configuration/tests/factories.py
+1
-0
No files found.
common/djangoapps/third_party_auth/management/commands/tests/test_data/another-testshib-providers.xml
0 → 100644
View file @
f3089e9e
<EntitiesDescriptor
Name=
"urn:mace:shibboleth:testshib:two"
xmlns=
"urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:ds=
"http://www.w3.org/2000/09/xmldsig#"
xmlns:mdalg=
"urn:oasis:names:tc:SAML:metadata:algsupport"
xmlns:mdui=
"urn:oasis:names:tc:SAML:metadata:ui"
xmlns:shibmd=
"urn:mace:shibboleth:metadata:1.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<!-- This file contains the metadata for the testing IdP and SP
that are operated by TestShib as a service for testing new
Shibboleth and SAML providers. -->
<EntityDescriptor
entityID=
"https://idp.testshib.org/idp/another-shibboleth"
>
<Extensions>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#sha512"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#sha384"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#sha256"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#sha1"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#rsa-sha1"
/>
</Extensions>
<IDPSSODescriptor
protocolSupportEnumeration=
"urn:oasis:names:tc:SAML:1.1:protocol urn:mace:shibboleth:1.0 urn:oasis:names:tc:SAML:2.0:protocol"
>
<Extensions>
<shibmd:Scope
regexp=
"false"
>
testshib.org
</shibmd:Scope>
<mdui:UIInfo>
<mdui:DisplayName
xml:lang=
"en"
>
TestShib Test IdP
</mdui:DisplayName>
<mdui:Description
xml:lang=
"en"
>
TestShib IdP. Use this as a source of attributes
for your test SP.
</mdui:Description>
<mdui:Logo
height=
"88"
width=
"253"
>
https://www.testshib.org/testshibtwo.jpg
</mdui:Logo>
</mdui:UIInfo>
</Extensions>
<!-- old signing key
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIEDjCCAvagAwIBAgIBADANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzEV
MBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYDVQQHEwpQaXR0c2J1cmdoMREwDwYD
VQQKEwhUZXN0U2hpYjEZMBcGA1UEAxMQaWRwLnRlc3Rza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KazGj16lfJhOBXldgrhppQBb0Nq6HKHguqmwRfJ+WkxemZXzhediAj
Geka8nz8JjwxpUjAiSWYKLtJhGEaTqCYxCCX2Dw+dOTqUzHOZ7WKv4JXPK5G/Uhr
8K/qhmFT2nIQi538n6rVYLeWj8Bbnl+ev0peYzxFyF5sQA==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc" />
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
</KeyDescriptor>
-->
<!-- new signing key -->
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIDAzCCAeugAwIBAgIVAPX0G6LuoXnKS0Muei006mVSBXbvMA0GCSqGSIb3DQEB
CwUAMBsxGTAXBgNVBAMMEGlkcC50ZXN0c2hpYi5vcmcwHhcNMTYwODIzMjEyMDU0
WhcNMzYwODIzMjEyMDU0WjAbMRkwFwYDVQQDDBBpZHAudGVzdHNoaWIub3JnMIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg9C4J2DiRTEhJAWzPt1S3ryh
m3M2P3hPpwJwvt2q948vdTUxhhvNMuc3M3S4WNh6JYBs53R+YmjqJAII4ShMGNEm
lGnSVfHorex7IxikpuDPKV3SNf28mCAZbQrX+hWA+ann/uifVzqXktOjs6DdzdBn
xoVhniXgC8WCJwKcx6JO/hHsH1rG/0DSDeZFpTTcZHj4S9MlLNUtt5JxRzV/MmmB
3ObaX0CMqsSWUOQeE4nylSlp5RWHCnx70cs9kwz5WrflnbnzCeHU2sdbNotBEeTH
ot6a2cj/pXlRJIgPsrL/4VSicPZcGYMJMPoLTJ8mdy6mpR6nbCmP7dVbCIm/DQID
AQABoz4wPDAdBgNVHQ4EFgQUUfaDa2mPi24x09yWp1OFXmZ2GPswGwYDVR0RBBQw
EoIQaWRwLnRlc3RzaGliLm9yZzANBgkqhkiG9w0BAQsFAAOCAQEASKKgqTxhqBzR
OZ1eVy++si+eTTUQZU4+8UywSKLia2RattaAPMAcXUjO+3cYOQXLVASdlJtt+8QP
dRkfp8SiJemHPXC8BES83pogJPYEGJsKo19l4XFJHPnPy+Dsn3mlJyOfAa8RyWBS
80u5lrvAcr2TJXt9fXgkYs7BOCigxtZoR8flceGRlAZ4p5FPPxQR6NDYb645jtOT
MVr3zgfjP6Wh2dt+2p04LG7ENJn8/gEwtXVuXCsPoSCDx9Y0QmyXTJNdV1aB0AhO
RkWPlFYwp+zOyOIR+3m1+pqWFpn0eT/HrxpdKa74FA3R2kq4R7dXe4G0kUgXTdqX
MLRKhDgdmA==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes256-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes192-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes128-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#tripledes-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-1_5"
/>
</KeyDescriptor>
<ArtifactResolutionService
Binding=
"urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
Location=
"https://idp.testshib.org:8443/idp/profile/SAML1/SOAP/ArtifactResolution"
index=
"1"
/>
<ArtifactResolutionService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
Location=
"https://idp.testshib.org:8443/idp/profile/SAML2/SOAP/ArtifactResolution"
index=
"2"
/>
<NameIDFormat>
urn:mace:shibboleth:1.0:nameIdentifier
</NameIDFormat>
<NameIDFormat>
urn:oasis:names:tc:SAML:2.0:nameid-format:transient
</NameIDFormat>
<SingleSignOnService
Binding=
"urn:mace:shibboleth:1.0:profiles:AuthnRequest"
Location=
"https://idp.testshib.org/idp/profile/Shibboleth/SSO"
/>
<SingleSignOnService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location=
"https://idp.testshib.org/idp/profile/SAML2/POST/SSO"
/>
<SingleSignOnService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location=
"https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO"
/>
<SingleSignOnService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
Location=
"https://idp.testshib.org/idp/profile/SAML2/SOAP/ECP"
/>
</IDPSSODescriptor>
<AttributeAuthorityDescriptor
protocolSupportEnumeration=
"urn:oasis:names:tc:SAML:1.1:protocol urn:oasis:names:tc:SAML:2.0:protocol"
>
<!-- old SSL/TLS
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIEDjCCAvagAwIBAgIBADANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzEV
MBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYDVQQHEwpQaXR0c2J1cmdoMREwDwYD
VQQKEwhUZXN0U2hpYjEZMBcGA1UEAxMQaWRwLnRlc3RzaGliLm9yZzAeFw0wNjA4
MzAyMTEyMjVaFw0xNjA4MjcyMTEyMjVaMGcxCzAJBgNVBAYTAlVTMRUwEwYDVQQI
EwxQZW5uc3lsdmFuaWExEzARBgNVBAcTClBpdHRzYnVyZ2gxETAPBgNVBAoTCFRl
c3RTaGliMRkwFwYDVQQDExBpZHAudGVzdHNoaWIub3JnMIIBIjANBgkqhk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ryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc" />
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
</KeyDescriptor>
-->
<!-- new SSL/TLS -->
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIDAzCCAeugAwIBAgIVAPX0G6LuoXnKS0Muei006mVSBXbvMA0GCSqGSIb3DQEB
CwUAMBsxGTAXBgNVBAMMEGlkcC50ZXN0c2hpYi5vcmcwHhcNMTYwODIzMjEyMDU0
WhcNMzYwODIzMjEyMDU0WjAbMRkwFwYDVQQDDBBpZHAudGVzdHNoaWIub3JnMIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg9C4J2DiRTEhJAWzPt1S3ryh
m3M2P3hPpwJwvt2q948vdTUxhhvNMuc3M3S4WNh6JYBs53R+YmjqJAII4ShMGNEm
lGnSVfHorex7IxikpuDPKV3SNf28mCAZbQrX+hWA+ann/uifVzqXktOjs6DdzdBn
xoVhniXgC8WCJwKcx6JO/hHsH1rG/0DSDeZFpTTcZHj4S9MlLNUtt5JxRzV/MmmB
3ObaX0CMqsSWUOQeE4nylSlp5RWHCnx70cs9kwz5WrflnbnzCeHU2sdbNotBEeTH
ot6a2cj/pXlRJIgPsrL/4VSicPZcGYMJMPoLTJ8mdy6mpR6nbCmP7dVbCIm/DQID
AQABoz4wPDAdBgNVHQ4EFgQUUfaDa2mPi24x09yWp1OFXmZ2GPswGwYDVR0RBBQw
EoIQaWRwLnRlc3RzaGliLm9yZzANBgkqhkiG9w0BAQsFAAOCAQEASKKgqTxhqBzR
OZ1eVy++si+eTTUQZU4+8UywSKLia2RattaAPMAcXUjO+3cYOQXLVASdlJtt+8QP
dRkfp8SiJemHPXC8BES83pogJPYEGJsKo19l4XFJHPnPy+Dsn3mlJyOfAa8RyWBS
80u5lrvAcr2TJXt9fXgkYs7BOCigxtZoR8flceGRlAZ4p5FPPxQR6NDYb645jtOT
MVr3zgfjP6Wh2dt+2p04LG7ENJn8/gEwtXVuXCsPoSCDx9Y0QmyXTJNdV1aB0AhO
RkWPlFYwp+zOyOIR+3m1+pqWFpn0eT/HrxpdKa74FA3R2kq4R7dXe4G0kUgXTdqX
MLRKhDgdmA==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes256-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes192-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes128-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#tripledes-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-1_5"
/>
</KeyDescriptor>
<AttributeService
Binding=
"urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
Location=
"https://idp.testshib.org:8443/idp/profile/SAML1/SOAP/AttributeQuery"
/>
<AttributeService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
Location=
"https://idp.testshib.org:8443/idp/profile/SAML2/SOAP/AttributeQuery"
/>
<NameIDFormat>
urn:mace:shibboleth:1.0:nameIdentifier
</NameIDFormat>
<NameIDFormat>
urn:oasis:names:tc:SAML:2.0:nameid-format:transient
</NameIDFormat>
</AttributeAuthorityDescriptor>
<Organization>
<OrganizationName
xml:lang=
"en"
>
TestShib Two Identity Provider
</OrganizationName>
<OrganizationDisplayName
xml:lang=
"en"
>
TestShib Two
</OrganizationDisplayName>
<OrganizationURL
xml:lang=
"en"
>
http://www.testshib.org/testshib-two/
</OrganizationURL>
</Organization>
<ContactPerson
contactType=
"technical"
>
<GivenName>
Nate
</GivenName>
<SurName>
Klingenstein
</SurName>
<EmailAddress>
ndk@internet2.edu
</EmailAddress>
</ContactPerson>
</EntityDescriptor>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<!-- Metadata for SP.TESTSHIB.ORG -->
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<EntityDescriptor
entityID=
"https://sp.testshib.org/another-shibboleth-sp"
>
<Extensions>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#sha512"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#sha384"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#sha256"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#sha224"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#sha1"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2009/xmldsig11#dsa-sha256"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#rsa-sha1"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#dsa-sha1"
/>
</Extensions>
<!-- An SP supporting SAML 1 and 2 contains this element with protocol support as shown. -->
<SPSSODescriptor
protocolSupportEnumeration=
"urn:oasis:names:tc:SAML:2.0:protocol urn:oasis:names:tc:SAML:1.1:protocol http://schemas.xmlsoap.org/ws/2003/07/secext"
>
<Extensions>
<!-- A request initiator at /Testshib that you can use to customize authentication requests issued to your IdP by TestShib. -->
<init:RequestInitiator
xmlns:init=
"urn:oasis:names:tc:SAML:profiles:SSO:request-init"
Binding=
"urn:oasis:names:tc:SAML:profiles:SSO:request-init"
Location=
"https://sp.testshib.org/Shibboleth.sso/TestShib"
/>
<mdui:UIInfo>
<mdui:DisplayName
xml:lang=
"en"
>
TestShib Test SP
</mdui:DisplayName>
<mdui:Description
xml:lang=
"en"
>
TestShib SP. Log into this to test your machine.
Once logged in check that all attributes that you expected have been
released.
</mdui:Description>
<mdui:Logo
height=
"88"
width=
"253"
>
https://www.testshib.org/testshibtwo.jpg
</mdui:Logo>
</mdui:UIInfo>
</Extensions>
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIEPjCCAyagAwIBAgIBADANBgkqhkiG9w0BAQUFADB3MQswCQYDVQQGEwJVUzEV
MBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYDVQQHEwpQaXR0c2J1cmdoMSIwIAYD
VQQKExlUZXN0U2hpYiBTZXJ2aWNlIFByb3ZpZGVyMRgwFgYDVQQDEw9zcC50ZXN0
c2hpYi5vcmcwHhcNMDYwODMwMjEyNDM5WhcNMTYwODI3MjEyNDM5WjB3MQswCQYD
VQQGEwJVUzEVMBMGA1UECBMM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CziDGzVA47TngKz2v
PVA+aokoOyoz3b53qeti77ijatSEoKjxheBWpO+eoJeGq/e49Um3M2ogIX/JAlMa
Inh+vYSYngQB2sx9LGkR9KHaMKNIGCDehk93Xla4pWJx1w==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2009/xmlenc11#aes128-gcm"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2009/xmlenc11#aes192-gcm"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2009/xmlenc11#aes256-gcm"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes128-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes192-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes256-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#tripledes-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2009/xmlenc11#rsa-oaep"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
/>
</KeyDescriptor>
<!-- This tells IdPs that Single Logout is supported and where/how to request it. -->
<SingleLogoutService
Location=
"https://sp.testshib.org/Shibboleth.sso/SLO/SOAP"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
/>
<SingleLogoutService
Location=
"https://sp.testshib.org/Shibboleth.sso/SLO/Redirect"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
/>
<SingleLogoutService
Location=
"https://sp.testshib.org/Shibboleth.sso/SLO/POST"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
/>
<SingleLogoutService
Location=
"https://sp.testshib.org/Shibboleth.sso/SLO/Artifact"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
/>
<!-- This tells IdPs that you only need transient identifiers. -->
<NameIDFormat>
urn:oasis:names:tc:SAML:2.0:nameid-format:transient
</NameIDFormat>
<NameIDFormat>
urn:mace:shibboleth:1.0:nameIdentifier
</NameIDFormat>
<!--
This tells IdPs where and how to send authentication assertions. Mostly
the SP will tell the IdP what location to use in its request, but this
is how the IdP validates the location and also figures out which
SAML version/binding to use.
-->
<AssertionConsumerService
index=
"1"
isDefault=
"true"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML2/POST"
/>
<AssertionConsumerService
index=
"2"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML2/POST-SimpleSign"
/>
<AssertionConsumerService
index=
"3"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML2/Artifact"
/>
<AssertionConsumerService
index=
"4"
Binding=
"urn:oasis:names:tc:SAML:1.0:profiles:browser-post"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML/POST"
/>
<AssertionConsumerService
index=
"5"
Binding=
"urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML/Artifact"
/>
<AssertionConsumerService
index=
"6"
Binding=
"http://schemas.xmlsoap.org/ws/2003/07/secext"
Location=
"https://sp.testshib.org/Shibboleth.sso/ADFS"
/>
<!-- A couple additional assertion consumers for the registration webapp. -->
<AssertionConsumerService
index=
"7"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location=
"https://www.testshib.org/Shibboleth.sso/SAML2/POST"
/>
<AssertionConsumerService
index=
"8"
Binding=
"urn:oasis:names:tc:SAML:1.0:profiles:browser-post"
Location=
"https://www.testshib.org/Shibboleth.sso/SAML/POST"
/>
</SPSSODescriptor>
<!-- This is just information about the entity in human terms. -->
<Organization>
<OrganizationName
xml:lang=
"en"
>
TestShib Two Service Provider
</OrganizationName>
<OrganizationDisplayName
xml:lang=
"en"
>
TestShib Two
</OrganizationDisplayName>
<OrganizationURL
xml:lang=
"en"
>
http://www.testshib.org/testshib-two/
</OrganizationURL>
</Organization>
<ContactPerson
contactType=
"technical"
>
<GivenName>
Nate
</GivenName>
<SurName>
Klingenstein
</SurName>
<EmailAddress>
ndk@internet2.edu
</EmailAddress>
</ContactPerson>
</EntityDescriptor>
</EntitiesDescriptor>
common/djangoapps/third_party_auth/management/commands/tests/test_data/testshib-providers.xml
0 → 100644
View file @
f3089e9e
<EntitiesDescriptor
Name=
"urn:mace:shibboleth:testshib:two"
xmlns=
"urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:ds=
"http://www.w3.org/2000/09/xmldsig#"
xmlns:mdalg=
"urn:oasis:names:tc:SAML:metadata:algsupport"
xmlns:mdui=
"urn:oasis:names:tc:SAML:metadata:ui"
xmlns:shibmd=
"urn:mace:shibboleth:metadata:1.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<!-- This file contains the metadata for the testing IdP and SP
that are operated by TestShib as a service for testing new
Shibboleth and SAML providers. -->
<EntityDescriptor
entityID=
"https://idp.testshib.org/idp/shibboleth"
>
<Extensions>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#sha512"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#sha384"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#sha256"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#sha1"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#rsa-sha1"
/>
</Extensions>
<IDPSSODescriptor
protocolSupportEnumeration=
"urn:oasis:names:tc:SAML:1.1:protocol urn:mace:shibboleth:1.0 urn:oasis:names:tc:SAML:2.0:protocol"
>
<Extensions>
<shibmd:Scope
regexp=
"false"
>
testshib.org
</shibmd:Scope>
<mdui:UIInfo>
<mdui:DisplayName
xml:lang=
"en"
>
TestShib Test IdP
</mdui:DisplayName>
<mdui:Description
xml:lang=
"en"
>
TestShib IdP. Use this as a source of attributes
for your test SP.
</mdui:Description>
<mdui:Logo
height=
"88"
width=
"253"
>
https://www.testshib.org/testshibtwo.jpg
</mdui:Logo>
</mdui:UIInfo>
</Extensions>
<!-- old signing key
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIEDjCCAvagAwIBAgIBADANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzEV
MBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYDVQQHEwpQaXR0c2J1cmdoMREwDwYD
VQQKEwhUZXN0U2hpYjEZMBcGA1UEAxMQaWRwLnRlc3RzaGliLm9yZzAeFw0wNjA4
MzAyMTEyMjVaFw0xNjA4MjcyMTEyMjVaMGcxCzAJBgNVBAYTAlVTMRUwEwYDVQQI
EwxQZW5uc3lsdmFuaWExEzARBgNVBAcTClBpdHRzYnVyZ2gxETAPBgNVBAoTCFRl
c3RTaGliMRkwFwYDVQQDExBpZHAudGVzdHNoaWIub3JnMIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEArYkCGuTmJp9eAOSGHwRJo1SNatB5ZOKqDM9ysg7C
yVTDClcpu93gSP10nH4gkCZOlnESNgttg0r+MqL8tfJC6ybddEFB3YBo8PZajKSe
3OQ01Ow3yT4I+Wdg1tsTpSge9gEz7SrC07EkYmHuPtd71CHiUaCWDv+xVfUQX0aT
NPFmDixzUjoYzbGDrtAyCqA8f9CN2txIfJnpHE6q6CmKcoLADS4UrNPlhHSzd614
kR/JYiks0K4kbRqCQF0Dv0P5Di+rEfefC6glV8ysC8dB5/9nb0yh/ojRuJGmgMWH
gWk6h0ihjihqiu4jACovUZ7vVOCgSE5Ipn7OIwqd93zp2wIDAQABo4HEMIHBMB0G
A1UdDgQWBBSsBQ869nh83KqZr5jArr4/7b+QazCBkQYDVR0jBIGJMIGGgBSsBQ86
9nh83KqZr5jArr4/7b+Qa6FrpGkwZzELMAkGA1UEBhMCVVMxFTATBgNVBAgTDFBl
bm5zeWx2YW5pYTETMBEGA1UEBxMKUGl0dHNidXJnaDERMA8GA1UEChMIVGVzdFNo
aWIxGTAXBgNVBAMTEGlkcC50ZXN0c2hpYi5vcmeCAQAwDAYDVR0TBAUwAwEB/zAN
BgkqhkiG9w0BAQUFAAOCAQEAjR29PhrCbk8qLN5MFfSVk98t3CT9jHZoYxd8QMRL
I4j7iYQxXiGJTT1FXs1nd4Rha9un+LqTfeMMYqISdDDI6tv8iNpkOAvZZUosVkUo
93pv1T0RPz35hcHHYq2yee59HJOco2bFlcsH8JBXRSRrJ3Q7Eut+z9uo80JdGNJ4
/SJy5UorZ8KazGj16lfJhOBXldgrhppQBb0Nq6HKHguqmwRfJ+WkxemZXzhediAj
Geka8nz8JjwxpUjAiSWYKLtJhGEaTqCYxCCX2Dw+dOTqUzHOZ7WKv4JXPK5G/Uhr
8K/qhmFT2nIQi538n6rVYLeWj8Bbnl+ev0peYzxFyF5sQA==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc" />
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
</KeyDescriptor>
-->
<!-- new signing key -->
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIDAzCCAeugAwIBAgIVAPX0G6LuoXnKS0Muei006mVSBXbvMA0GCSqGSIb3DQEB
CwUAMBsxGTAXBgNVBAMMEGlkcC50ZXN0c2hpYi5vcmcwHhcNMTYwODIzMjEyMDU0
WhcNMzYwODIzMjEyMDU0WjAbMRkwFwYDVQQDDBBpZHAudGVzdHNoaWIub3JnMIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg9C4J2DiRTEhJAWzPt1S3ryh
m3M2P3hPpwJwvt2q948vdTUxhhvNMuc3M3S4WNh6JYBs53R+YmjqJAII4ShMGNEm
lGnSVfHorex7IxikpuDPKV3SNf28mCAZbQrX+hWA+ann/uifVzqXktOjs6DdzdBn
xoVhniXgC8WCJwKcx6JO/hHsH1rG/0DSDeZFpTTcZHj4S9MlLNUtt5JxRzV/MmmB
3ObaX0CMqsSWUOQeE4nylSlp5RWHCnx70cs9kwz5WrflnbnzCeHU2sdbNotBEeTH
ot6a2cj/pXlRJIgPsrL/4VSicPZcGYMJMPoLTJ8mdy6mpR6nbCmP7dVbCIm/DQID
AQABoz4wPDAdBgNVHQ4EFgQUUfaDa2mPi24x09yWp1OFXmZ2GPswGwYDVR0RBBQw
EoIQaWRwLnRlc3RzaGliLm9yZzANBgkqhkiG9w0BAQsFAAOCAQEASKKgqTxhqBzR
OZ1eVy++si+eTTUQZU4+8UywSKLia2RattaAPMAcXUjO+3cYOQXLVASdlJtt+8QP
dRkfp8SiJemHPXC8BES83pogJPYEGJsKo19l4XFJHPnPy+Dsn3mlJyOfAa8RyWBS
80u5lrvAcr2TJXt9fXgkYs7BOCigxtZoR8flceGRlAZ4p5FPPxQR6NDYb645jtOT
MVr3zgfjP6Wh2dt+2p04LG7ENJn8/gEwtXVuXCsPoSCDx9Y0QmyXTJNdV1aB0AhO
RkWPlFYwp+zOyOIR+3m1+pqWFpn0eT/HrxpdKa74FA3R2kq4R7dXe4G0kUgXTdqX
MLRKhDgdmA==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes256-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes192-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes128-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#tripledes-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-1_5"
/>
</KeyDescriptor>
<ArtifactResolutionService
Binding=
"urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
Location=
"https://idp.testshib.org:8443/idp/profile/SAML1/SOAP/ArtifactResolution"
index=
"1"
/>
<ArtifactResolutionService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
Location=
"https://idp.testshib.org:8443/idp/profile/SAML2/SOAP/ArtifactResolution"
index=
"2"
/>
<NameIDFormat>
urn:mace:shibboleth:1.0:nameIdentifier
</NameIDFormat>
<NameIDFormat>
urn:oasis:names:tc:SAML:2.0:nameid-format:transient
</NameIDFormat>
<SingleSignOnService
Binding=
"urn:mace:shibboleth:1.0:profiles:AuthnRequest"
Location=
"https://idp.testshib.org/idp/profile/Shibboleth/SSO"
/>
<SingleSignOnService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location=
"https://idp.testshib.org/idp/profile/SAML2/POST/SSO"
/>
<SingleSignOnService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location=
"https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO"
/>
<SingleSignOnService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
Location=
"https://idp.testshib.org/idp/profile/SAML2/SOAP/ECP"
/>
</IDPSSODescriptor>
<AttributeAuthorityDescriptor
protocolSupportEnumeration=
"urn:oasis:names:tc:SAML:1.1:protocol urn:oasis:names:tc:SAML:2.0:protocol"
>
<!-- old SSL/TLS
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIEDjCCAvagAwIBAgIBADANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzEV
MBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYDVQQHEwpQaXR0c2J1cmdoMREwDwYD
VQQKEwhUZXN0U2hpYjEZMBcGA1UEAxMQaWRwLnRlc3RzaGliLm9yZzAeFw0wNjA4
MzAyMTEyMjVaFw0xNjA4MjcyMTEyMjVaMGcxCzAJBgNVBAYTAlVTMRUwEwYDVQQI
EwxQZW5uc3lsdmFuaWExEzARBgNVBAcTClBpdHRzYnVyZ2gxETAPBgNVBAoTCFRl
c3RTaGliMRkwFwYDVQQDExBpZHAudGVzdHNoaWIub3JnMIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEArYkCGuTmJp9eAOSGHwRJo1SNatB5ZOKqDM9ysg7C
yVTDClcpu93gSP10nH4gkCZOlnESNgttg0r+MqL8tfJC6ybddEFB3YBo8PZajKSe
3OQ01Ow3yT4I+Wdg1tsTpSge9gEz7SrC07EkYmHuPtd71CHiUaCWDv+xVfUQX0aT
NPFmDixzUjoYzbGDrtAyCqA8f9CN2txIfJnpHE6q6CmKcoLADS4UrNPlhHSzd614
kR/JYiks0K4kbRqCQF0Dv0P5Di+rEfefC6glV8ysC8dB5/9nb0yh/ojRuJGmgMWH
gWk6h0ihjihqiu4jACovUZ7vVOCgSE5Ipn7OIwqd93zp2wIDAQABo4HEMIHBMB0G
A1UdDgQWBBSsBQ869nh83KqZr5jArr4/7b+QazCBkQYDVR0jBIGJMIGGgBSsBQ86
9nh83KqZr5jArr4/7b+Qa6FrpGkwZzELMAkGA1UEBhMCVVMxFTATBgNVBAgTDFBl
bm5zeWx2YW5pYTETMBEGA1UEBxMKUGl0dHNidXJnaDERMA8GA1UEChMIVGVzdFNo
aWIxGTAXBgNVBAMTEGlkcC50ZXN0c2hpYi5vcmeCAQAwDAYDVR0TBAUwAwEB/zAN
BgkqhkiG9w0BAQUFAAOCAQEAjR29PhrCbk8qLN5MFfSVk98t3CT9jHZoYxd8QMRL
I4j7iYQxXiGJTT1FXs1nd4Rha9un+LqTfeMMYqISdDDI6tv8iNpkOAvZZUosVkUo
93pv1T0RPz35hcHHYq2yee59HJOco2bFlcsH8JBXRSRrJ3Q7Eut+z9uo80JdGNJ4
/SJy5UorZ8KazGj16lfJhOBXldgrhppQBb0Nq6HKHguqmwRfJ+WkxemZXzhediAj
Geka8nz8JjwxpUjAiSWYKLtJhGEaTqCYxCCX2Dw+dOTqUzHOZ7WKv4JXPK5G/Uhr
8K/qhmFT2nIQi538n6rVYLeWj8Bbnl+ev0peYzxFyF5sQA==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc" />
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
</KeyDescriptor>
-->
<!-- new SSL/TLS -->
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIDAzCCAeugAwIBAgIVAPX0G6LuoXnKS0Muei006mVSBXbvMA0GCSqGSIb3DQEB
CwUAMBsxGTAXBgNVBAMMEGlk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http://www.w3.org/2001/04/xmlenc#aes192-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes128-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#tripledes-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-1_5"
/>
</KeyDescriptor>
<AttributeService
Binding=
"urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding"
Location=
"https://idp.testshib.org:8443/idp/profile/SAML1/SOAP/AttributeQuery"
/>
<AttributeService
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
Location=
"https://idp.testshib.org:8443/idp/profile/SAML2/SOAP/AttributeQuery"
/>
<NameIDFormat>
urn:mace:shibboleth:1.0:nameIdentifier
</NameIDFormat>
<NameIDFormat>
urn:oasis:names:tc:SAML:2.0:nameid-format:transient
</NameIDFormat>
</AttributeAuthorityDescriptor>
<Organization>
<OrganizationName
xml:lang=
"en"
>
TestShib Two Identity Provider
</OrganizationName>
<OrganizationDisplayName
xml:lang=
"en"
>
TestShib Two
</OrganizationDisplayName>
<OrganizationURL
xml:lang=
"en"
>
http://www.testshib.org/testshib-two/
</OrganizationURL>
</Organization>
<ContactPerson
contactType=
"technical"
>
<GivenName>
Nate
</GivenName>
<SurName>
Klingenstein
</SurName>
<EmailAddress>
ndk@internet2.edu
</EmailAddress>
</ContactPerson>
</EntityDescriptor>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<!-- Metadata for SP.TESTSHIB.ORG -->
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<EntityDescriptor
entityID=
"https://sp.testshib.org/shibboleth-sp"
>
<Extensions>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#sha512"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#sha384"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#sha256"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#sha224"
/>
<mdalg:DigestMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#sha1"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2009/xmldsig11#dsa-sha256"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#rsa-sha1"
/>
<mdalg:SigningMethod
Algorithm=
"http://www.w3.org/2000/09/xmldsig#dsa-sha1"
/>
</Extensions>
<!-- An SP supporting SAML 1 and 2 contains this element with protocol support as shown. -->
<SPSSODescriptor
protocolSupportEnumeration=
"urn:oasis:names:tc:SAML:2.0:protocol urn:oasis:names:tc:SAML:1.1:protocol http://schemas.xmlsoap.org/ws/2003/07/secext"
>
<Extensions>
<!-- A request initiator at /Testshib that you can use to customize authentication requests issued to your IdP by TestShib. -->
<init:RequestInitiator
xmlns:init=
"urn:oasis:names:tc:SAML:profiles:SSO:request-init"
Binding=
"urn:oasis:names:tc:SAML:profiles:SSO:request-init"
Location=
"https://sp.testshib.org/Shibboleth.sso/TestShib"
/>
<mdui:UIInfo>
<mdui:DisplayName
xml:lang=
"en"
>
TestShib Test SP
</mdui:DisplayName>
<mdui:Description
xml:lang=
"en"
>
TestShib SP. Log into this to test your machine.
Once logged in check that all attributes that you expected have been
released.
</mdui:Description>
<mdui:Logo
height=
"88"
width=
"253"
>
https://www.testshib.org/testshibtwo.jpg
</mdui:Logo>
</mdui:UIInfo>
</Extensions>
<KeyDescriptor>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIEPjCCAyagAwIBAgIBADANBgkqhkiG9w0BAQUFADB3MQswCQYDVQQGEwJVUzEV
MBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYDVQQHEwpQaXR0c2J1cmdoMSIwIAYD
VQQKExlUZXN0U2hpYiBTZXJ2aWNlIFByb3ZpZGVyMRgwFgYDVQQDEw9zcC50ZXN0
c2hpYi5vcmcwHhcNMDYwODMwMjEyNDM5WhcNMTYwODI3MjEyNDM5WjB3MQswCQYD
VQQGEwJVUzEVMBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYDVQQHEwpQaXR0c2J1
cmdoMSIwIAYDVQQKExlUZXN0U2hpYiBTZXJ2aWNlIFByb3ZpZGVyMRgwFgYDVQQD
Ew9zcC50ZXN0c2hpYi5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
AQDJyR6ZP6MXkQ9z6RRziT0AuCabDd3x1m7nLO9ZRPbr0v1LsU+nnC363jO8nGEq
sqkgiZ/bSsO5lvjEt4ehff57ERio2Qk9cYw8XCgmYccVXKH9M+QVO1MQwErNobWb
AjiVkuhWcwLWQwTDBowfKXI87SA7KR7sFUymNx5z1aoRvk3GM++tiPY6u4shy8c7
vpWbVfisfTfvef/y+galxjPUQYHmegu7vCbjYP3On0V7/Ivzr+r2aPhp8egxt00Q
XpilNai12LBYV3Nv/lMsUzBeB7+CdXRVjZOHGuQ8mGqEbsj8MBXvcxIKbcpeK5Zi
JCVXPfarzuriM1G5y5QkKW+LAgMBAAGjgdQwgdEwHQYDVR0OBBYEFKB6wPDxwYrY
StNjU5P4b4AjBVQVMIGhBgNVHSMEgZkwgZaAFKB6wPDxwYrYStNjU5P4b4AjBVQV
oXukeTB3MQswCQYDVQQGEwJVUzEVMBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYD
VQQHEwpQaXR0c2J1cmdoMSIwIAYDVQQKExlUZXN0U2hpYiBTZXJ2aWNlIFByb3Zp
ZGVyMRgwFgYDVQQDEw9zcC50ZXN0c2hpYi5vcmeCAQAwDAYDVR0TBAUwAwEB/zAN
BgkqhkiG9w0BAQUFAAOCAQEAc06Kgt7ZP6g2TIZgMbFxg6vKwvDL0+2dzF11Onpl
5sbtkPaNIcj24lQ4vajCrrGKdzHXo9m54BzrdRJ7xDYtw0dbu37l1IZVmiZr12eE
Iay/5YMU+aWP1z70h867ZQ7/7Y4HW345rdiS6EW663oH732wSYNt9kr7/0Uer3KD
9CuPuOidBacospDaFyfsaJruE99Kd6Eu/w5KLAGG+m0iqENCziDGzVA47TngKz2v
PVA+aokoOyoz3b53qeti77ijatSEoKjxheBWpO+eoJeGq/e49Um3M2ogIX/JAlMa
Inh+vYSYngQB2sx9LGkR9KHaMKNIGCDehk93Xla4pWJx1w==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2009/xmlenc11#aes128-gcm"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2009/xmlenc11#aes192-gcm"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2009/xmlenc11#aes256-gcm"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes128-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes192-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#aes256-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#tripledes-cbc"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2009/xmlenc11#rsa-oaep"
/>
<EncryptionMethod
Algorithm=
"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
/>
</KeyDescriptor>
<!-- This tells IdPs that Single Logout is supported and where/how to request it. -->
<SingleLogoutService
Location=
"https://sp.testshib.org/Shibboleth.sso/SLO/SOAP"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
/>
<SingleLogoutService
Location=
"https://sp.testshib.org/Shibboleth.sso/SLO/Redirect"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
/>
<SingleLogoutService
Location=
"https://sp.testshib.org/Shibboleth.sso/SLO/POST"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
/>
<SingleLogoutService
Location=
"https://sp.testshib.org/Shibboleth.sso/SLO/Artifact"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
/>
<!-- This tells IdPs that you only need transient identifiers. -->
<NameIDFormat>
urn:oasis:names:tc:SAML:2.0:nameid-format:transient
</NameIDFormat>
<NameIDFormat>
urn:mace:shibboleth:1.0:nameIdentifier
</NameIDFormat>
<!--
This tells IdPs where and how to send authentication assertions. Mostly
the SP will tell the IdP what location to use in its request, but this
is how the IdP validates the location and also figures out which
SAML version/binding to use.
-->
<AssertionConsumerService
index=
"1"
isDefault=
"true"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML2/POST"
/>
<AssertionConsumerService
index=
"2"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML2/POST-SimpleSign"
/>
<AssertionConsumerService
index=
"3"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML2/Artifact"
/>
<AssertionConsumerService
index=
"4"
Binding=
"urn:oasis:names:tc:SAML:1.0:profiles:browser-post"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML/POST"
/>
<AssertionConsumerService
index=
"5"
Binding=
"urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"
Location=
"https://sp.testshib.org/Shibboleth.sso/SAML/Artifact"
/>
<AssertionConsumerService
index=
"6"
Binding=
"http://schemas.xmlsoap.org/ws/2003/07/secext"
Location=
"https://sp.testshib.org/Shibboleth.sso/ADFS"
/>
<!-- A couple additional assertion consumers for the registration webapp. -->
<AssertionConsumerService
index=
"7"
Binding=
"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location=
"https://www.testshib.org/Shibboleth.sso/SAML2/POST"
/>
<AssertionConsumerService
index=
"8"
Binding=
"urn:oasis:names:tc:SAML:1.0:profiles:browser-post"
Location=
"https://www.testshib.org/Shibboleth.sso/SAML/POST"
/>
</SPSSODescriptor>
<!-- This is just information about the entity in human terms. -->
<Organization>
<OrganizationName
xml:lang=
"en"
>
TestShib Two Service Provider
</OrganizationName>
<OrganizationDisplayName
xml:lang=
"en"
>
TestShib Two
</OrganizationDisplayName>
<OrganizationURL
xml:lang=
"en"
>
http://www.testshib.org/testshib-two/
</OrganizationURL>
</Organization>
<ContactPerson
contactType=
"technical"
>
<GivenName>
Nate
</GivenName>
<SurName>
Klingenstein
</SurName>
<EmailAddress>
ndk@internet2.edu
</EmailAddress>
</ContactPerson>
</EntityDescriptor>
</EntitiesDescriptor>
common/djangoapps/third_party_auth/management/commands/tests/test_saml.py
View file @
f3089e9e
...
...
@@ -3,11 +3,45 @@ Tests for `saml` management command, this command fetches saml metadata from pro
existing data accordingly.
"""
import
unittest
import
os
import
mock
from
django.test
import
TestCase
from
django.core.management
import
call_command
from
django.core.management.base
import
CommandError
from
django.conf
import
settings
from
django.utils.six
import
StringIO
from
requests.models
import
Response
from
third_party_auth.tests.factories
import
SAMLConfigurationFactory
,
SAMLProviderConfigFactory
def
mock_get
(
status_code
=
200
):
"""
Args:
status_code (int): integer showing the status code for the response object.
Returns:
returns a function that can be used as a mock function for requests.get.
"""
def
_
(
url
=
None
,
*
args
,
**
kwargs
):
# pylint: disable=unused-argument
"""
mock method for requests.get, this method will read xml file, form a Response object from the
contents of this file, set status code and return the Response object.
"""
url
=
url
.
split
(
"/"
)[
-
1
]
if
url
else
"testshib-providers.xml"
file_path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
"/test_data/{}"
.
format
(
url
)
with
open
(
file_path
)
as
providers
:
xml
=
providers
.
read
()
response
=
Response
()
response
.
_content
=
xml
# pylint: disable=protected-access
response
.
status_code
=
status_code
return
response
return
_
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
...
...
@@ -15,6 +49,28 @@ class TestSAMLCommand(TestCase):
"""
Test django management command for fetching saml metadata.
"""
def
setUp
(
self
):
"""
Setup operations for saml configurations. these operations contain
creation of SAMLConfiguration and SAMLProviderConfig records in database.
"""
super
(
TestSAMLCommand
,
self
)
.
setUp
()
self
.
stdout
=
StringIO
()
# We are creating SAMLConfiguration instance here so that there is always at-least one
# disabled saml configuration instance, this is done to verify that disabled configurations are
# not processed.
SAMLConfigurationFactory
.
create
(
enabled
=
False
)
SAMLProviderConfigFactory
.
create
()
def
__create_saml_configurations__
(
self
,
saml_config
=
None
,
saml_provider_config
=
None
):
"""
Helper method to create SAMLConfiguration and AMLProviderConfig.
"""
SAMLConfigurationFactory
.
create
(
enabled
=
True
,
**
(
saml_config
or
{}))
SAMLProviderConfigFactory
.
create
(
enabled
=
True
,
**
(
saml_provider_config
or
{}))
def
test_raises_command_error_for_invalid_arguments
(
self
):
"""
Test that management command raises `CommandError` with a proper message in case of
...
...
@@ -29,3 +85,82 @@ class TestSAMLCommand(TestCase):
# Call `saml` command without any argument so that it raises a CommandError
with
self
.
assertRaisesMessage
(
CommandError
,
"Command can only be used with '--pull' option."
):
call_command
(
"saml"
,
pull
=
False
)
def
test_no_saml_configuration
(
self
):
"""
Test that management command completes without errors and logs correct information when no
saml configurations are enabled/present.
"""
# Capture command output log for testing.
call_command
(
"saml"
,
pull
=
True
,
stdout
=
self
.
stdout
)
self
.
assertIn
(
'Done. Fetched 0 total. 0 were updated and 0 failed.'
,
self
.
stdout
.
getvalue
())
@mock.patch
(
"requests.get"
,
mock_get
())
def
test_fetch_saml_metadata
(
self
):
"""
Test that management command completes without errors and logs correct information when
one or more saml configurations are enabled.
"""
# Create enabled configurations
self
.
__create_saml_configurations__
()
# Capture command output log for testing.
call_command
(
"saml"
,
pull
=
True
,
stdout
=
self
.
stdout
)
self
.
assertIn
(
'Done. Fetched 1 total. 1 were updated and 0 failed.'
,
self
.
stdout
.
getvalue
())
@mock.patch
(
"requests.get"
,
mock_get
(
status_code
=
404
))
def
test_fetch_saml_metadata_failure
(
self
):
"""
Test that management command completes with proper message for errors
and logs correct information.
"""
# Create enabled configurations
self
.
__create_saml_configurations__
()
# Capture command output log for testing.
call_command
(
"saml"
,
pull
=
True
,
stdout
=
self
.
stdout
)
self
.
assertIn
(
'Done. Fetched 1 total. 0 were updated and 1 failed.'
,
self
.
stdout
.
getvalue
())
@mock.patch
(
"requests.get"
,
mock_get
(
status_code
=
200
))
def
test_fetch_multiple_providers_data
(
self
):
"""
Test that management command completes with proper message for error or success
and logs correct information when there are multiple providers with their data.
"""
# Create enabled configurations
self
.
__create_saml_configurations__
()
# Add another set of configurations
self
.
__create_saml_configurations__
(
saml_config
=
{
"site__domain"
:
"second.testserver.fake"
,
},
saml_provider_config
=
{
"site__domain"
:
"second.testserver.fake"
,
"idp_slug"
:
"second-test-shib"
,
"entity_id"
:
"https://idp.testshib.org/idp/another-shibboleth"
,
"metadata_source"
:
"https://www.testshib.org/metadata/another-testshib-providers.xml"
,
}
)
# Add another set of configurations
self
.
__create_saml_configurations__
(
saml_config
=
{
"site__domain"
:
"third.testserver.fake"
,
},
saml_provider_config
=
{
"site__domain"
:
"third.testserver.fake"
,
"idp_slug"
:
"third-test-shib"
,
# Note: This entity id will not be present in returned response and will cause failed update.
"entity_id"
:
"https://idp.testshib.org/idp/non-existent-shibboleth"
,
"metadata_source"
:
"https://www.testshib.org/metadata/third/testshib-providers.xml"
,
}
)
# Capture command output log for testing.
call_command
(
"saml"
,
pull
=
True
,
stdout
=
self
.
stdout
)
self
.
assertIn
(
'Done. Fetched 3 total. 2 were updated and 1 failed.'
,
self
.
stdout
.
getvalue
())
common/djangoapps/third_party_auth/tests/factories.py
0 → 100644
View file @
f3089e9e
"""
Provides factories for third_party_auth models.
"""
from
factory
import
SubFactory
from
factory.django
import
DjangoModelFactory
from
third_party_auth.models
import
SAMLConfiguration
,
SAMLProviderConfig
from
openedx.core.djangoapps.site_configuration.tests.factories
import
SiteFactory
class
SAMLConfigurationFactory
(
DjangoModelFactory
):
"""
Factory or SAMLConfiguration model in third_party_auth app.
"""
class
Meta
(
object
):
model
=
SAMLConfiguration
site
=
SubFactory
(
SiteFactory
)
enabled
=
True
class
SAMLProviderConfigFactory
(
DjangoModelFactory
):
"""
Factory or SAMLProviderConfig model in third_party_auth app.
"""
class
Meta
(
object
):
model
=
SAMLProviderConfig
django_get_or_create
=
(
'idp_slug'
,
'metadata_source'
,
"entity_id"
)
site
=
SubFactory
(
SiteFactory
)
enabled
=
True
idp_slug
=
"test-shib"
name
=
"TestShib College"
entity_id
=
"https://idp.testshib.org/idp/shibboleth"
metadata_source
=
"https://www.testshib.org/metadata/testshib-providers.xml"
openedx/core/djangoapps/site_configuration/tests/factories.py
View file @
f3089e9e
...
...
@@ -24,6 +24,7 @@ class SiteFactory(DjangoModelFactory):
"""
class
Meta
(
object
):
model
=
Site
django_get_or_create
=
(
'domain'
,)
domain
=
'testserver.fake'
name
=
'testserver.fake'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment