Skip to content

Instantly share code, notes, and snippets.

View korteke's full-sized avatar

Keijo Korte korteke

View GitHub Profile
<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#">
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>
<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>
<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>
@korteke
korteke / NOTICE_WHITESPACES_DOTS.txt
Created March 11, 2016 14:26
First the actual code that tries to crete request. Second method that creates webRequest. Third snippet from the .NET tracing.
System.Net Verbose: 0 : [4612] 00000000 : 3C 3F 78 6D 6C 20 76 65-72 73 69 6F 6E 3D 22 31 : <?xml version="1
System.Net Verbose: 0 : [4612] 00000010 : 2E 30 22 20 65 6E 63 6F-64 69 6E 67 3D 22 55 54 : .0" encoding="UT
System.Net Verbose: 0 : [4612] 00000020 : 46 2D 38 22 3F 3E 0D 0A-3C 53 4F 41 50 2D 45 4E : F-8"?>..<SOAP-EN
System.Net Verbose: 0 : [4612] 00000030 : 56 3A 45 6E 76 65 6C 6F-70 65 20 78 6D 6C 6E 73 : V:Envelope xmlns
System.Net Verbose: 0 : [4612] 00000040 : 3A 53 4F 41 50 2D 45 4E-56 3D 22 68 74 74 70 3A : :SOAP-ENV="http:
System.Net Verbose: 0 : [4612] 00000050 : 2F 2F 73 63 68 65 6D 61-73 2E 78 6D 6C 73 6F 61 : //schemas.xmlsoa
System.Net Verbose: 0 : [4612] 00000060 : 70 2E 6F 72 67 2F 73 6F-61 70 2F 65 6E 76 65 6C : p.org/soap/envel
System.Net Verbose: 0 : [4612] 00000070 : 6F 70 65 2F 22 3E 0D 0A-20 20 3C 53 4F 41 50 2D : ope/">.. <SOAP-
System.Net Verbose: 0 : [4612] 00000080 : 45 4E 56 3A 42 6F 64 79-3E 0D 0A 20 20 20 20 3C : ENV:Body>.. <
System.Net Verbose: 0 : [4612] 00000090 : 7
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow.xsd"
parent="intercept.abstract">
<!-- Rudimentary impediment to direct execution of subflow. -->
<input name="calledAsSubflow" type="boolean" required="true" />
<!-- Attribute consent setup. -->
package fi.csc.shibboleth.mobileauth.impl.authn;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@korteke
korteke / DestroySession.java
Created April 13, 2016 10:46
Tiedostopolut: /opt/shibboleth-idp/system/flows/intercept/ Oikea tapa on tehdä system-hakemiston tiedostoista omat versiot /opt/shibboleth-idp/flows/intercept hakemistoon. System-hakemiston alla olevia tiedostoja ei ole tarkoitus muokata! Ekassa bean joka pitää lisätä muiden jatkoksi. Tokassa flow, jossa tärkeimpänä rivit 122-132. Kolmanessa its…
/*
* The MIT License
* Copyright (c) 2016 CSC - IT Center for Science, http://www.csc.fi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:

Keybase proof

I hereby claim:

  • I am korteke on github.
  • I am korteke (https://keybase.io/korteke) on keybase.
  • I have a public key whose fingerprint is ADB0 4965 FD10 71F6 2F2F E343 ECA3 6E6D 87B0 3A87

To claim this, I am signing this object:

{
"handler": {
"type": "Router",
"audit": "global",
"baseURI": "http://app.example.com:8081",
"capture": "all"
},
"heap": [
{
"name": "LogSink",