[java-oidc-common] 02/02: JCOMOIDC-129 - Add profile option for reverting 'aud' claims in JWT authentication assertions to tokenEndpointURL

Henri Mikkonen henri.mikkonen at iki.fi
Fri Jun 6 08:29:59 UTC 2025


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

hjmikkon 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=b140707d3b225f594254cc38853e9b9b09487f91

commit b140707d3b225f594254cc38853e9b9b09487f91
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Jun 6 11:29:09 2025 +0300

    JCOMOIDC-129 - Add profile option for reverting 'aud' claims in JWT authentication assertions to tokenEndpointURL
    
    https://shibboleth.atlassian.net/browse/JCOMOIDC-129
    
    Lookup function for the profile configuration option
---
 ...argetedEndpointAsJWTAudienceLookupFunction.java | 53 ++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/UseTargetedEndpointAsJWTAudienceLookupFunction.java b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/UseTargetedEndpointAsJWTAudienceLookupFunction.java
new file mode 100644
index 0000000..1967338
--- /dev/null
+++ b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/UseTargetedEndpointAsJWTAudienceLookupFunction.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.oidc.profile.config.navigate;
+
+import javax.annotation.Nullable;
+
+import org.opensaml.profile.context.ProfileRequestContext;
+
+import net.shibboleth.profile.config.ProfileConfiguration;
+import net.shibboleth.profile.context.RelyingPartyContext;
+import net.shibboleth.profile.context.logic.AbstractRelyingPartyPredicate;
+import net.shibboleth.oidc.profile.oauth2.config.OAuth2ClientAuthenticableClientProfileConfiguration;
+
+/**
+ * A predicate that returns 
+ * {@link OAuth2ClientAuthenticableClientProfileConfiguration#isUseTargetedEndpointAsJWTAudience(ProfileRequestContext)}
+ * if such a profile is available from a {@link RelyingPartyContext} obtained via a lookup function, by default a child
+ * of the {@link ProfileRequestContext}.
+ * 
+ * <p>
+ * If a specific setting is unavailable, a false value is returned.
+ * </p>
+ * 
+ * @since 3.3.0
+ */
+public class UseTargetedEndpointAsJWTAudienceLookupFunction extends AbstractRelyingPartyPredicate {
+
+    /** {@inheritDoc} */
+    @Override
+    public boolean test(@Nullable final ProfileRequestContext input) {
+        final RelyingPartyContext rpc = getRelyingPartyContextLookupStrategy().apply(input);
+        if (rpc != null) {
+            final ProfileConfiguration pc = rpc.getProfileConfig();
+            if (pc instanceof OAuth2ClientAuthenticableClientProfileConfiguration ocacpc) {
+                return ocacpc.isUseTargetedEndpointAsJWTAudience(input);
+            }
+        }
+        return false;
+    }
+
+}
\ 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