Made audience URIs configurable.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 19 Feb 2003 20:11:57 +0000 (20:11 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 19 Feb 2003 20:11:57 +0000 (20:11 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@481 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/AASaml.java
src/edu/internet2/middleware/shibboleth/aa/AAServlet.java
src/edu/internet2/middleware/shibboleth/common/Constants.java
src/edu/internet2/middleware/shibboleth/hs/HandleServlet.java

index a70ddd3..98b31bc 100755 (executable)
@@ -90,7 +90,7 @@ import edu.internet2.middleware.shibboleth.common.SAMLBindingFactory;
 
 public class AASaml {
 
-    String[] policies = { Constants.POLICY_INCOMMON };
+    String[] policies;
     String myName;
     StringBuffer sharName;
     SAMLRequest sreq;
@@ -98,7 +98,7 @@ public class AASaml {
     SAMLBinding binding;
     private static Logger log = Logger.getLogger(AASaml.class.getName());        
 
-    public AASaml(String myName) throws SAMLException {
+    public AASaml(String myName, String[] policies) throws SAMLException {
         binding = SAMLBindingFactory.getInstance(SAMLBinding.SAML_SOAP_HTTPS);
         this.myName = myName;
     }
index a40b81c..e511fbe 100755 (executable)
@@ -167,6 +167,7 @@ public class AAServlet extends HttpServlet {
                defaultProps.setProperty(
                        "edu.internet2.middleware.shibboleth.hs.provider.CryptoHandleRepository.keyStorePath",
                        "/conf/handle.jks");
+               defaultProps.setProperty("edu.internet2.middleware.shibboleth.audiences", "urn:mace:InCommon:pilot:2003");
 
                //Load from file
                Properties properties = new Properties(defaultProps);
@@ -204,7 +205,12 @@ public class AAServlet extends HttpServlet {
 
                try {
                        saml =
-                               new AASaml(configuration.getProperty("edu.internet2.middleware.shibboleth.aa.AAServlet.authorityName"));
+                               new AASaml(
+                                       configuration.getProperty("edu.internet2.middleware.shibboleth.aa.AAServlet.authorityName"),
+                                       configuration.getProperty("edu.internet2.middleware.shibboleth.audiences").replaceAll(
+                                               "\\s",
+                                               "").split(
+                                               ","));
                        saml.receive(req);
 
                        log.info("Attribute Query Handle for this request: (" + saml.getHandle() + ").");
@@ -259,7 +265,7 @@ public class AAServlet extends HttpServlet {
 
                } catch (SAMLException se) {
                        //log.error("AA failed for " + principal.getName() + " because of: " + se);
-                       try { 
+                       try {
                                saml.fail(resp, se);
                                return;
                        } catch (Exception ee) {
index ec291d2..ada0160 100755 (executable)
@@ -57,9 +57,6 @@ package edu.internet2.middleware.shibboleth.common;
  */
 public final class Constants
 {
-    /**  Club Shibboleth policy */
-    public final static String POLICY_INCOMMON = "urn:mace:InCommon:2003";
-
     /**  Shibboleth AttributeNamespace indicating URI-based naming of Attributes */
     public final static String SHIB_ATTRIBUTE_NAMESPACE_URI = "urn:mace:shibboleth:1.0:attributeNamespace:uri";
 }
index d890433..3f65fdd 100644 (file)
@@ -106,6 +106,7 @@ public class HandleServlet extends HttpServlet {
                defaultProps.setProperty(
                        "edu.internet2.middleware.shibboleth.hs.provider.CryptoHandleRepository.keyStorePath",
                        "/conf/handle.jks");
+               defaultProps.setProperty("edu.internet2.middleware.shibboleth.audiences", "urn:mace:InCommon:pilot:2003");
 
                //Load from file
                Properties properties = new Properties(defaultProps);
@@ -127,7 +128,8 @@ public class HandleServlet extends HttpServlet {
                                        "edu.internet2.middleware.shibboleth.hs.HandleServlet.keyStorePath",
                                        "edu.internet2.middleware.shibboleth.hs.HandleServlet.keyStorePassword",
                                        "edu.internet2.middleware.shibboleth.hs.HandleServlet.keyStoreKeyAlias",
-                                       "edu.internet2.middleware.shibboleth.hs.HandleServlet.keyStoreKeyPassword" };
+                                       "edu.internet2.middleware.shibboleth.hs.HandleServlet.keyStoreKeyPassword",
+                                       "edu.internet2.middleware.shibboleth.audiences" };
 
                        for (int i = 0; i < requiredProperties.length; i++) {
                                if (properties.getProperty(requiredProperties[i]) == null) {
@@ -172,7 +174,7 @@ public class HandleServlet extends HttpServlet {
 
                        postProfile =
                                ShibPOSTProfileFactory.getInstance(
-                                       Arrays.asList(new String[] { Constants.POLICY_INCOMMON }),
+                                       Arrays.asList(configuration.getProperty("edu.internet2.middleware.shibboleth.audiences").replaceAll("\\s", "") .split(",")),
                                        configuration.getProperty("edu.internet2.middleware.shibboleth.hs.HandleServlet.issuer"));
 
                        handleRepository = HandleRepositoryFactory.getInstance(configuration);