[java-identity-provider] branch main updated: Redo discovery config via property.

Scott Cantor cantor.2 at osu.edu
Mon Sep 14 13:46:50 UTC 2020


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=b4e6dfc2a2ba0fbc1848467a266e99eb27828622

The following commit(s) were added to refs/heads/main by this push:
       new  b4e6dfc2a Redo discovery config via property.
b4e6dfc2a is described below

commit b4e6dfc2a2ba0fbc1848467a266e99eb27828622
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Sep 14 09:46:40 2020 -0400

    Redo discovery config via property.
---
 .../shibboleth/idp/flows/authn/discovery-beans.xml | 11 +++----
 .../src/main/resources/conf/authn/authn.properties |  3 ++
 .../main/resources/conf/authn/discovery-config.xml | 34 ----------------------
 3 files changed, 9 insertions(+), 39 deletions(-)

diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/discovery-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/discovery-beans.xml
index a137e684d..99c59e2c0 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/discovery-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/discovery-beans.xml
@@ -18,15 +18,16 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <!-- Default strategy function to obtain the external path. -->
-    <bean id="shibboleth.authn.discoveryURLStrategy" parent="shibboleth.Functions.Constant" lazy-init="true"
-        c:target-ref="shibboleth.authn.discoveryURL" />
+    <!-- Legacy compatibility location to define strategy/location. -->
+    <import resource="conditional:%{idp.home}/conf/authn/discovery-config.xml" />
 
-    <import resource="%{idp.home}/conf/authn/discovery-config.xml" />
+    <!-- Default strategy function to obtain the external path. -->
+    <bean id="DefaultDiscoveryURLStrategy" parent="shibboleth.Functions.Constant" lazy-init="true"
+        c:target="#{getObject('shibboleth.authn.discoveryURL') ?: %{idp.authn.discoveryURL:}}" />
 
     <bean id="DiscoveryProfileRequestFunction" lazy-init="true"
         class="net.shibboleth.idp.authn.proxy.impl.DiscoveryProfileRequestFunction"
-        p:discoveryURLLookupStrategy-ref="shibboleth.authn.discoveryURLStrategy" />
+        p:discoveryURLLookupStrategy="#{getObject('shibboleth.authn.discoveryURLStrategy') ?: getObject('DefaultDiscoveryURLStrategy')}" />
 
     <!-- Action beans. -->
 
diff --git a/idp-conf/src/main/resources/conf/authn/authn.properties b/idp-conf/src/main/resources/conf/authn/authn.properties
index 65fde982d..80da96247 100644
--- a/idp-conf/src/main/resources/conf/authn/authn.properties
+++ b/idp-conf/src/main/resources/conf/authn/authn.properties
@@ -21,6 +21,9 @@ idp.authn.flows = Password
 # doesn't match the identity in a pre-existing session.
 #idp.authn.identitySwitchIsError = false
 
+# If using IdP discovery feature, provides a discovery location to use.
+#idp.authn.discoveryURL = https://ds.example.org/shibboleth-ds/index.html
+
 # Properties below override specific method behavior, as an alternative
 # to defining Spring beans in XML. Refer to the documentation for a complete
 # list. Most of the properties below are mentioned only because they are
diff --git a/idp-conf/src/main/resources/conf/authn/discovery-config.xml b/idp-conf/src/main/resources/conf/authn/discovery-config.xml
deleted file mode 100644
index 761982d98..000000000
--- a/idp-conf/src/main/resources/conf/authn/discovery-config.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:context="http://www.springframework.org/schema/context"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:p="http://www.springframework.org/schema/p"
-       xmlns:c="http://www.springframework.org/schema/c"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-                           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
-                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
-                           
-       default-init-method="initialize"
-       default-destroy-method="destroy">
-
-    <!-- Specify discovery service location. -->
-    
-    <bean id="shibboleth.authn.discoveryURL" class="java.lang.String"
-        c:_0="https://ds.example.org/shibboleth-ds/index.html" />
- 
-    <!-- Alternatively specify a Function<ProfileRequestContext,String> to return the URL. -->
-    <!--
-    <bean id="shibboleth.authn.discoveryURLStrategy"
-            parent="shibboleth.ContextFunctions.Scripted" factory-method="inlineScript">
-        <constructor-arg>
-            <value>
-            <![CDATA[
-                "https://ds.example.org/shibboleth-ds/index.html";
-            ]]>
-            </value>
-        </constructor-arg>
-    </bean>
-    -->
- 
-</beans>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list