Skip to content

Instantly share code, notes, and snippets.

@serac
serac / JsonServiceRegistryDao.java
Created June 5, 2013 20:49
CAS JSON service registry that support read/write operations and is a suitable backend to the service manager UI.
/*
$Id$
Copyright (C) 2013 Virginia Tech.
All rights reserved.
SEE LICENSE FOR MORE INFORMATION
Author: Middleware
Email: middleware@vt.edu
@serac
serac / deployerConfigContext.xml
Created June 13, 2013 20:11
PolicyBasedAuthenticationManager Example
<bean id="passwordHandler"
class="org.jasig.cas.authentication.LdapAuthenticationHandler">
<!-- Details elided for simplicity -->
</bean>
<bean id="oneTimePasswordHandler"
class="com.example.cas.authentication.CustomOTPAuthenticationHandler"
p:name="oneTimePasswordHandler" />
<bean id="authenticationPolicy"
@serac
serac / deployerConfigContext.xml
Last active December 19, 2015 02:48
CAS LDAP Configuration for Active Directory
<bean id="ldapAuthenticationHandler"
class="org.jasig.cas.authentication.LdapAuthenticationHandler"
p:principalIdAttribute="sAMAccountName"
c:authenticator-ref="authenticator">
<property name="principalAttributeMap">
<map>
<!--
| This map provides a simple attribute resolution mechanism.
| Keys are LDAP attribute names, values are CAS attribute names.
| Use this facility instead of a PrincipalResolver if LDAP is
@serac
serac / deployerConfigContext.xml
Last active December 19, 2015 02:49
CAS LDAP Configuration for Directory Supporting Anonymous Search
<bean id="ldapAuthenticationHandler"
class="org.jasig.cas.authentication.LdapAuthenticationHandler"
p:principalIdAttribute="uid"
c:authenticator-ref="authenticator">
<property name="principalAttributeMap">
<map>
<!--
| This map provides a simple attribute resolution mechanism.
| Keys are LDAP attribute names, values are CAS attribute names.
| This facility can be used instead or in addition to PrincipalResolver
@serac
serac / deployerConfigContext.xml
Created June 28, 2013 18:22
CAS LDAP Configuration for Directory Supporting Authenticated Search
<bean id="ldapAuthenticationHandler"
class="org.jasig.cas.authentication.LdapAuthenticationHandler"
p:principalIdAttribute="uid"
c:authenticator-ref="authenticator">
<property name="principalAttributeMap">
<map>
<!--
| This map provides a simple attribute resolution mechanism.
| Keys are LDAP attribute names, values are CAS attribute names.
| Use this facility instead of a PrincipalResolver if LDAP is
@serac
serac / deployerConfigContext.xml
Last active December 19, 2015 02:59
CAS LDAP Configuration for Directory Supporting Direct Bind
<bean id="ldapAuthenticationHandler"
class="org.jasig.cas.authentication.LdapAuthenticationHandler"
p:principalIdAttribute="uid"
c:authenticator-ref="authenticator">
<property name="principalAttributeMap">
<map>
<!--
| This map provides a simple attribute resolution mechanism.
| Keys are LDAP attribute names, values are CAS attribute names.
| Use this facility instead of a PrincipalResolver if LDAP is
@serac
serac / JsonServiceRegistryDao.java
Created October 8, 2013 15:29
JSON service registry suitable for HA environments (i.e. files can be stored on NFS and safely accessed from multiple hosts).
package edu.vt.middleware.cas.services;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
@serac
serac / factory-bean-resource.diff
Last active December 25, 2015 17:09
Use Spring Resource abstraction for describing PKI credential locations.
Index: src/main/java/net/shibboleth/ext/spring/factory/PrivateKeyFactoryBean.java
===================================================================
--- src/main/java/net/shibboleth/ext/spring/factory/PrivateKeyFactoryBean.java (revision 459)
+++ src/main/java/net/shibboleth/ext/spring/factory/PrivateKeyFactoryBean.java (working copy)
@@ -17,8 +17,6 @@
package net.shibboleth.ext.spring.factory;
-import java.io.File;
-import java.io.FileInputStream;
@serac
serac / AssertionUtil.cs
Created March 13, 2014 14:20
Utility class to dig out attributes from .NET CAS Client assertion.
/*
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a
* copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
@serac
serac / test-extension-flow.diff
Created July 21, 2014 16:59
User-Defined Flow Test
Index: idp-conf/src/test/java/net/shibboleth/idp/test/flows/ExtensionFlowTest.java
===================================================================
--- idp-conf/src/test/java/net/shibboleth/idp/test/flows/ExtensionFlowTest.java (revision 0)
+++ idp-conf/src/test/java/net/shibboleth/idp/test/flows/ExtensionFlowTest.java (working copy)
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache