[java-idp-oidc] 01/02: Use shibboleth.oidc.JSONObjectMapper instead of the global one

Henri Mikkonen henri.mikkonen at iki.fi
Fri Feb 18 07:10:13 UTC 2022


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

hjmikkon pushed a commit to branch main
in repository java-idp-oidc.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-oidc.git;a=commit;h=32e4d6123fca5594729a8171af9ccd346b710258

commit 32e4d6123fca5594729a8171af9ccd346b710258
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Feb 18 09:08:10 2022 +0200

    Use shibboleth.oidc.JSONObjectMapper instead of the global one
    
    This bean is configured to read and write timestamps as nanoseconds.
---
 .../META-INF/net.shibboleth.idp/postconfig.xml     | 36 +++++++++++++++++++++-
 .../idp/flows/oidc/register/register-beans.xml     |  2 +-
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/idp-oidc-extension-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml b/idp-oidc-extension-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
index bb38eac3..80025284 100644
--- a/idp-oidc-extension-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
+++ b/idp-oidc-extension-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
@@ -228,5 +228,39 @@
             <bean class="net.shibboleth.idp.plugin.oidc.op.profile.context.navigate.DefaultOIDCMetadataContextLookupFunction" />
         </constructor-arg>
     </bean>
-    
+
+    <bean id="shibboleth.oidc.JSONObjectMapper" class="com.fasterxml.jackson.databind.ObjectMapper"/>
+
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject" ref="shibboleth.oidc.JSONObjectMapper" />
+        <property name="targetMethod" value="configure" />
+        <property name="arguments">
+            <list>
+                <value type="com.fasterxml.jackson.databind.DeserializationFeature">READ_DATE_TIMESTAMPS_AS_NANOSECONDS</value>
+                <value>false</value>
+            </list>
+        </property>
+    </bean>
+
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject" ref="shibboleth.oidc.JSONObjectMapper" />
+        <property name="targetMethod" value="configure" />
+        <property name="arguments">
+            <list>
+                <value type="com.fasterxml.jackson.databind.SerializationFeature">WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS</value>
+                <value>false</value>
+            </list>
+        </property>
+    </bean>
+
+    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject" ref="shibboleth.oidc.JSONObjectMapper" />
+        <property name="targetMethod" value="registerModule" />
+        <property name="arguments">
+            <list>
+                <bean class="com.fasterxml.jackson.datatype.jsr310.JavaTimeModule"/>
+            </list>
+        </property>
+    </bean>
+
 </beans>
diff --git a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/register/register-beans.xml b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/register/register-beans.xml
index 41bc7da7..ab94fb98 100644
--- a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/register/register-beans.xml
+++ b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/register/register-beans.xml
@@ -30,7 +30,7 @@
         class="net.shibboleth.idp.plugin.oidc.op.profile.impl.ValidateRegistrationAccessToken" scope="prototype"
         p:revocationCache-ref="shibboleth.oidc.RevocationCache"
         p:sealer-ref="#{'%{idp.oidc.dynreg.tokenSealer:shibboleth.oidc.TokenSealer}'.trim()}"
-        p:objectMapper-ref="shibboleth.JSONObjectMapper" />
+        p:objectMapper-ref="shibboleth.oidc.JSONObjectMapper" />
         
     <bean id="ValidateRegistrationRequestMetadata"
         class="net.shibboleth.idp.plugin.oidc.op.profile.impl.ValidateRegistrationRequestMetadata" scope="prototype" />

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


More information about the commits mailing list