[java-idp-plugin-totp] branch main updated: Example and parent beans for static TOTP seeds.

Scott Cantor cantor.2 at osu.edu
Mon Aug 17 14:01:49 UTC 2020


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

scantor pushed a commit to branch main
in repository java-idp-plugin-totp.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-totp.git;a=commit;h=a310360435931ea5252ac8fe8364843be8a43131

The following commit(s) were added to refs/heads/main by this push:
       new  a310360   Example and parent beans for static TOTP seeds.
a310360 is described below

commit a310360435931ea5252ac8fe8364843be8a43131
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Aug 17 10:01:39 2020 -0400

    Example and parent beans for static TOTP seeds.
---
 totp-dist/src/main/resources/conf/totp-authn-config.xml | 17 ++++++++++++++++-
 .../idp/plugin/totp/impl/StaticSeedSource.java          |  2 --
 .../net/shibboleth/idp/flows/authn/TOTP/TOTP-beans.xml  |  9 ++++++---
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/totp-dist/src/main/resources/conf/totp-authn-config.xml b/totp-dist/src/main/resources/conf/totp-authn-config.xml
index ab7a175..21a2307 100644
--- a/totp-dist/src/main/resources/conf/totp-authn-config.xml
+++ b/totp-dist/src/main/resources/conf/totp-authn-config.xml
@@ -22,5 +22,20 @@
     <!--
     <bean id="shibboleth.authn.TOTP.TokenSeedAttribute" class="java.lang.String" c:_0="tokenSeeds" />
     -->
-    
+
+    <!-- Example static seed mappings for testing or simple use cases. -->
+    <!--
+    <bean id="shibboleth.authn.TOTP.SeedSource" parent="shibboleth.authn.TOTP.StaticSeedSource">
+        <property name="seeds">
+            <map>
+                <entry key="jdoe">
+                    <list>
+                        <value>K44GQWBAI54IQELEGYPDZG5LAJ6EJX73</value>
+                    </list>
+                </entry>
+            </map>
+        </property>
+    </bean>
+    -->
+     
 </beans>
diff --git a/totp-impl/src/main/java/net/shibboleth/idp/plugin/totp/impl/StaticSeedSource.java b/totp-impl/src/main/java/net/shibboleth/idp/plugin/totp/impl/StaticSeedSource.java
index 5cd3f94..ea84da3 100644
--- a/totp-impl/src/main/java/net/shibboleth/idp/plugin/totp/impl/StaticSeedSource.java
+++ b/totp-impl/src/main/java/net/shibboleth/idp/plugin/totp/impl/StaticSeedSource.java
@@ -42,8 +42,6 @@ import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
 /**
  * Token seed source implementation that returns statically defined values.
- * 
- * <p>Values must be base32-encoded.</p>
  */
 @ThreadSafeAfterInit
 public class StaticSeedSource extends AbstractSeedSource {
diff --git a/totp-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/TOTP/TOTP-beans.xml b/totp-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/TOTP/TOTP-beans.xml
index 961fef1..b2afcbd 100644
--- a/totp-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/TOTP/TOTP-beans.xml
+++ b/totp-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/TOTP/TOTP-beans.xml
@@ -21,9 +21,9 @@
     <import resource="TOTP-authenticator.xml" />
 
     <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
-            p:cacheSeconds="%{idp.message.cacheSeconds:300}"
-            p:basenames="classpath:/net/shibboleth/idp/plugin/totp/messages"
-            p:defaultEncoding="UTF-8" />
+        p:cacheSeconds="%{idp.message.cacheSeconds:300}"
+        p:basenames="classpath:/net/shibboleth/idp/plugin/totp/messages"
+        p:defaultEncoding="UTF-8" />
 
     <bean id="ExtractTOTPFromHeader"
         class="net.shibboleth.idp.plugin.totp.impl.ExtractTOTPFromHeader" scope="prototype"
@@ -60,4 +60,7 @@
         p:attributeResolver-ref="shibboleth.AttributeResolverService"
         p:sourceAttribute="#{getObject('shibboleth.authn.TOTP.TokenSeedAttribute') ?: T(net.shibboleth.idp.plugin.totp.impl.AttributeResolverSeedSource).DEFAULT_ATTRIBUTE_ID}" />
 
+    <!-- Parent bean for use of alternative seed source. -->
+    <bean id="shibboleth.authn.TOTP.StaticSeedSource" class="net.shibboleth.idp.plugin.totp.impl.StaticSeedSource" abstract="true" />
+
 </beans>

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


More information about the commits mailing list