Skip to content

Instantly share code, notes, and snippets.

@serac
serac / find-incommon-r_and_s.py
Last active August 29, 2015 14:07
Python script to find R&S entities in InCommon metadata
#!/usr/bin/env python
import xml.etree.ElementTree as ET
import urllib2
response = urllib2.urlopen('http://md.incommon.org/InCommon/InCommon-metadata.xml')
try:
data = response.read()
finally:
response.close()
@serac
serac / animation.html
Last active August 29, 2015 14:09
Simple Web Animation
<html>
<head>
<title>Simple Web Animation</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</head>
<body style="font-family:Helvetica,sans-serif">
<form>
<fieldset style="border:2px solid #999; width:50%; margin:auto auto">
<label for="imgurl">Image URL</label>
@serac
serac / idpctl
Created December 17, 2014 14:47
IdP Startup Script
#!/bin/bash
#
#==================================================================
#
# Shibboleth IdP application control script.
# Supported operations:
# - start
# - stop
# - restart
# - status
@serac
serac / X509AuthServlet.java.diff
Created April 27, 2015 16:25
Extensible X509AuthServlet
Index: idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/X509AuthServlet.java
===================================================================
--- idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/X509AuthServlet.java (revision 7486)
+++ idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/X509AuthServlet.java (working copy)
@@ -35,6 +35,7 @@
import net.shibboleth.idp.authn.ExternalAuthentication;
import net.shibboleth.idp.authn.ExternalAuthenticationException;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+import net.shibboleth.utilities.java.support.collection.Pair;
import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
@serac
serac / PolicyTrustEngine.java
Last active August 29, 2015 14:20
Custom OpenSAML trust engine for enforcing certificate policies are satisfied
package edu.vt.middleware.idp.authn;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
import org.bouncycastle.asn1.x509.PolicyInformation;
import org.cryptacular.x509.ExtensionReader;
import org.opensaml.security.trust.TrustEngine;
import org.opensaml.security.x509.X509Credential;
import org.slf4j.Logger;
@serac
serac / java-idp.diff
Created July 21, 2015 14:45
Conditional setup of RequestedAuthnContext on initial authn
Index: idp-conf/src/main/resources/conf/idp.properties
===================================================================
--- idp-conf/src/main/resources/conf/idp.properties (revision 7643)
+++ idp-conf/src/main/resources/conf/idp.properties (working copy)
@@ -101,6 +101,12 @@
# usually in conjunction with the idp.authn.resolveAttribute property below.
#idp.authn.flows.initial = Password
+# If true the same constraints are applied to the initial authn flow as the
+# "regular" authn flow to ensure the authentication requirements of the
@serac
serac / SaslAuthzBindActivator.java
Created August 14, 2015 20:16
Ldaptive activator that sets SASL authorization ID based on IdP request artifacts.
package edu.vt.middleware.idp.authn;
import com.google.common.base.Function;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.logic.ConstraintViolationException;
import org.ldaptive.*;
import org.ldaptive.pool.Activator;
import org.ldaptive.sasl.SaslConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@serac
serac / LogoutPropagationFlowDescriptor-api-changes.diff
Created October 5, 2015 14:42
Proposed LogoutPropagationFlowDescriptor API changes
Index: idp-conf/src/main/resources/system/conf/session-manager-system.xml
===================================================================
--- idp-conf/src/main/resources/system/conf/session-manager-system.xml (revision 7797)
+++ idp-conf/src/main/resources/system/conf/session-manager-system.xml (working copy)
@@ -76,13 +76,15 @@
<!-- Built-in logout propagation flows. -->
- <bean id="logoutprop/saml2" class="net.shibboleth.idp.session.LogoutPropagationFlowDescriptor">
- <property name="activationCondition">
@serac
serac / resolve-by-role-and-protocol.diff
Created December 7, 2015 21:35
Proposal to support resolving entities by role and protocol
Index: opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractBatchMetadataResolver.java
===================================================================
--- opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractBatchMetadataResolver.java (revision 4412)
+++ opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractBatchMetadataResolver.java (working copy)
@@ -25,10 +25,7 @@
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
-import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
-import net.shibboleth.utilities.java.support.resolver.ResolverException;
@serac
serac / CasAssertionUtil.java
Last active January 26, 2016 21:37
Utility class to read data from CAS assertion
import org.jasig.cas.client.util.AssertionHolder;
import org.jasig.cas.client.validation.Assertion;
import org.jasig.cas.client.authentication.AttributePrincipal;
/**
* Helper class that reads data from CAS assertion.
* Prerequisite: Must have configured AssertionThreadLocalFilter as described at
* https://github.com/jasig/java-cas-client#orgjasigcasclientutilassertionthreadlocalfilter.
* Depends on ThreadLocal under the hood, so not suitable for servlet 3.0 async usage.
*/