Skip to content

Instantly share code, notes, and snippets.

View korteke's full-sized avatar

Keijo Korte korteke

View GitHub Profile
<saml:Subject xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
<saml:NameID>myself@testshib.org</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData Recipient="https://idp.testshib.org:8443/idp/profile/SAML2/SOAP/AttributeQuery"/>
</saml:SubjectConfirmation>
</saml:Subject>
<samlp:AttributeQuery Destination="https://idp.testshib.org:8443/idp/profile/SAML2/SOAP/AttributeQuery" ID="_79B77720E3833008BCF03BEEB58944BB" IssueInstant="2016-03-03T20:06:47.261Z" Version="2.0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://saml-sp2-local.azurewebsites.net</saml:Issuer>
<saml:Subject xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
<saml:NameID>myself@testshib.org</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData Recipient="https://idp.testshib.org:8443/idp/profile/SAML2/SOAP/AttributeQuery"/>
</saml:SubjectConfirmation>
</saml:Subject>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
try {
string aaURL = "https://idp.testshib.org:8443/idp/profile/SAML2/SOAP/AttributeQuery";
//Testing subject
NameId subje = new NameId(userName,null,null,SamlNameIdentifierFormat.Unspecified,aaURL);
//Testing subject
Subject subject = new Subject(new NameId(userName));
SubjectConfirmation subjectConfirmation = new SubjectConfirmation(SamlSubjectConfirmationMethod.Bearer);
SubjectConfirmationData subjectConfirmationData = new SubjectConfirmationData();
subjectConfirmationData.Recipient = aaURL;
<samlp:AttributeQuery Destination="https://idp.testshib.org:8443/idp/profile/SAML2/SOAP/AttributeQuery" ID="_79B77720E3833008BCF03BEEB58944BB" IssueInstant="2016-03-03T20:06:47.261Z" Version="2.0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://saml-sp2-local.azurewebsites.net</saml:Issuer>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#_79B77720E3833008BCF03BEEB58944BB">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">