Skip to content

Instantly share code, notes, and snippets.

@badri
Last active November 7, 2022 06:25
Show Gist options
  • Save badri/fb53c94974b6a2231a55700242779d45 to your computer and use it in GitHub Desktop.
Save badri/fb53c94974b6a2231a55700242779d45 to your computer and use it in GitHub Desktop.
working SAML 1/2 token
<saml:Assertion xmlns:saml="http://www.example.com/saas/assertion">
<Signature>
<KeyAlias>17GLrwRZj5LzsI7lNyxTJd0EGPeXYT6qbb7lcLsCTwQ</KeyAlias>
<SignatureValue>RRx7/7yOIERFv86xTmrT8Ojq7G5cQkg51duzNSp8TEul+OJmMC4MMptOsWihbRadhxh9XGmQiPeB8tYFTjbLaTKBuv5XK1B2JQCc0OOXndZEq9wNH+IHpaXSb60XpqHY</SignatureValue>
</Signature>
<saml:Subject>
<saml:NameID SPNameQualifier="http://sp.example.com/demo1/metadata.php" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient">_ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData NotOnOrAfter="2024-01-18T06:21:48Z" Recipient="http://sp.example.com/demo1/index.php?acs" InResponseTo="ONELOGIN_4fee3b046395c4e751011e97f8900b5273d56685"/>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="2014-07-17T01:01:18Z" NotOnOrAfter="2024-01-18T06:21:48Z">
<saml:AudienceRestriction>
<saml:Audience>http://sp.example.com/demo1/metadata.php</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AttributeStatement>
<saml:Attribute Name="uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue>test</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="IP" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue>192.0.0.99</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="CAM" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue>40</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="mail" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue>[email protected]</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="eduPersonAffiliation" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue>users</saml:AttributeValue>
<saml:AttributeValue>examplerole1</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment