[java-oidc-common] branch main updated: JCOMOIDC-130 - Add profile option to set header type parameter of client authentication JWTs

Phil Smart philip.smart at jisc.ac.uk
Wed Jun 4 10:17:34 UTC 2025


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

philsmart pushed a commit to branch main
in repository java-oidc-common.

View the commit online:
http://git.shibboleth.net/view/?p=java-oidc-common.git;a=commit;h=8dfec3edf3aa2cdd195cedfbf80dfdab2530a03b

The following commit(s) were added to refs/heads/main by this push:
     new 8dfec3e  JCOMOIDC-130 - Add profile option to set header type parameter of client authentication JWTs
8dfec3e is described below

commit 8dfec3edf3aa2cdd195cedfbf80dfdab2530a03b
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Jun 4 11:17:32 2025 +0100

    JCOMOIDC-130 - Add profile option to set header type parameter of client
    authentication JWTs
    
     - Add ClientAuthenticationJWTType profile option
    
    https://shibboleth.atlassian.net/browse/JCOMOIDC-130
---
 ...entAuthenticableClientProfileConfiguration.java | 13 ++++++++
 ...th2ClientAuthenticableProfileConfiguration.java | 35 ++++++++++++++++++++++
 2 files changed, 48 insertions(+)

diff --git a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/oauth2/config/OAuth2ClientAuthenticableClientProfileConfiguration.java b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/oauth2/config/OAuth2ClientAuthenticableClientProfileConfiguration.java
index 56c8f16..51bfadc 100644
--- a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/oauth2/config/OAuth2ClientAuthenticableClientProfileConfiguration.java
+++ b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/oauth2/config/OAuth2ClientAuthenticableClientProfileConfiguration.java
@@ -85,5 +85,18 @@ public interface OAuth2ClientAuthenticableClientProfileConfiguration
      */
     @ConfigurationSetting(name="useTargetedEndpointAsJWTAudience")
     boolean isUseTargetedEndpointAsJWTAudience(@Nullable final ProfileRequestContext profileRequestContext);
+    
+    /**
+     * Get the 'typ' header parameter value for a client authentication JWT.
+     * 
+     * @param profileRequestContext the profile request context
+     * 
+     * @return the 'typ' header parameter value for a client authentication JWT.
+     * 
+     * @since 3.3.0
+     */
+    @ConfigurationSetting(name="clientAuthenticationJWTType")
+    @Nullable @NotEmpty String getClientAuthenticationJWTType(
+            @Nullable final ProfileRequestContext profileRequestContext);
 
 }
diff --git a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/oauth2/config/impl/AbstractOAuth2ClientAuthenticableProfileConfiguration.java b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/oauth2/config/impl/AbstractOAuth2ClientAuthenticableProfileConfiguration.java
index ba9322c..1c21556 100644
--- a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/oauth2/config/impl/AbstractOAuth2ClientAuthenticableProfileConfiguration.java
+++ b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/oauth2/config/impl/AbstractOAuth2ClientAuthenticableProfileConfiguration.java
@@ -107,6 +107,9 @@ public abstract class AbstractOAuth2ClientAuthenticableProfileConfiguration
      * is the audience must be the issuer identifier of the recipient.
      */
     @Nonnull private Predicate<ProfileRequestContext> useTargetedEndpointAsJWTAudiencePredicate;
+    
+    /** Lookup function to determine the 'typ' header parameter value for a client authentication JWT.*/
+    @Nonnull private Function<ProfileRequestContext,String> clientAuthenticationJWTTypeLookupStrategy;
 
     /**
      * Constructor.
@@ -138,6 +141,7 @@ public abstract class AbstractOAuth2ClientAuthenticableProfileConfiguration
         requireDpopProofPredicate = PredicateSupport.alwaysFalse();
         dpopProofNonceGeneratorLookupStrategy = FunctionSupport.constant(null);
         useTargetedEndpointAsJWTAudiencePredicate = PredicateSupport.alwaysFalse();
+        clientAuthenticationJWTTypeLookupStrategy = FunctionSupport.constant(null);
     }
 
     /** {@inheritDoc} */
@@ -659,4 +663,35 @@ public abstract class AbstractOAuth2ClientAuthenticableProfileConfiguration
     public void setUseTargetedEndpointAsJWTAudience(final boolean flag) {
         useTargetedEndpointAsJWTAudiencePredicate = flag ? PredicateSupport.alwaysTrue() : PredicateSupport.alwaysFalse();
     }
+    
+    /** {@inheritDoc} */
+    @Override
+    public String getClientAuthenticationJWTType(final ProfileRequestContext profileRequestContext) {
+        return clientAuthenticationJWTTypeLookupStrategy.apply(profileRequestContext);
+    }
+    
+    /**
+     * Set a lookup strategy to determine the 'typ' header parameter value for a client authentication JWT.
+     * 
+     * @param strategy lookup strategy
+     * 
+     * @since 3.3.0
+     */
+    public void setClientAuthenticationJWTTypeLookupStrategy(
+            @Nonnull final Function<ProfileRequestContext, String> strategy) {
+        clientAuthenticationJWTTypeLookupStrategy = Constraint.isNotNull(strategy,
+                "ClientAuthenticationJWTTypeLookupStrategy can not be null");
+    }
+    
+    /**
+     * Set the 'typ' header parameter value for a client authentication JWT.
+     * 
+     * @param strategy lookup strategy
+     * 
+     * @since 3.3.0
+     */
+    public void setClientAuthenticationJWTType(@Nonnull @NotEmpty final String type) {
+        clientAuthenticationJWTTypeLookupStrategy = 
+                FunctionSupport.constant(Constraint.isNotEmpty(type, "Collection of methods cannot be null"));
+    }
 }
\ No newline at end of file

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


More information about the commits mailing list