[java-oidc-common] branch main updated: JCOMOIDC-100 - Allowed ResponseModes should be configurable

Henri Mikkonen henri.mikkonen at iki.fi
Fri Mar 15 12:22:27 UTC 2024


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=9b377cf8e1a5ecc3354d6e3905d271ed38175692

The following commit(s) were added to refs/heads/main by this push:
     new 9b377cf  JCOMOIDC-100 - Allowed ResponseModes should be configurable
9b377cf is described below

commit 9b377cf8e1a5ecc3354d6e3905d271ed38175692
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Mar 15 14:21:32 2024 +0200

    JCOMOIDC-100 - Allowed ResponseModes should be configurable
    
    https://shibboleth.atlassian.net/browse/JCOMOIDC-100
    
    Added an access function and event identifier for invalid response mode.
---
 .../navigate/ResponseModesLookupFunction.java      | 54 ++++++++++++++++++++++
 .../shibboleth/oidc/profile/core/OidcEventIds.java |  9 +++-
 2 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/ResponseModesLookupFunction.java b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/ResponseModesLookupFunction.java
new file mode 100644
index 0000000..f354e48
--- /dev/null
+++ b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/ResponseModesLookupFunction.java
@@ -0,0 +1,54 @@
+/*
+ * 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 java.util.Set;
+
+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.navigate.AbstractRelyingPartyLookupFunction;
+import net.shibboleth.oidc.profile.oauth2.config.OAuth2AuthorizationProfileConfiguration;
+
+/**
+ * A function that returns
+ * {@link OAuth2AuthorizationProfileConfiguration#getResponseModes(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 null value is returned.</p>
+ * 
+ * @since 3.1.0
+ */
+public class ResponseModesLookupFunction extends AbstractRelyingPartyLookupFunction<Set<String>> {
+
+    /** {@inheritDoc} */
+    @Override
+    @Nullable public Set<String> apply(@Nullable final ProfileRequestContext input) {
+        final RelyingPartyContext rpc = getRelyingPartyContextLookupStrategy().apply(input);
+        if (rpc != null) {
+            final ProfileConfiguration pc = rpc.getProfileConfig();
+            if (pc instanceof OAuth2AuthorizationProfileConfiguration) {
+                return ((OAuth2AuthorizationProfileConfiguration) pc).getResponseModes(input);
+            }
+        }
+
+        return null;
+    }
+
+}
\ No newline at end of file
diff --git a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OidcEventIds.java b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OidcEventIds.java
index 6f51093..a0ae31f 100644
--- a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OidcEventIds.java
+++ b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OidcEventIds.java
@@ -48,7 +48,14 @@ public final class OidcEventIds {
      * The response type in request is not supported for RP.
      */
     @Nonnull @NotEmpty public static final String INVALID_RESPONSE_TYPE = "InvalidResponseType";
-    
+
+    /**
+     * The response type in request is not supported for RP.
+     * 
+     * @since 3.1.0
+     */
+    @Nonnull @NotEmpty public static final String INVALID_RESPONSE_MODE = "InvalidResponseMode";
+
     /**
      * The grant type in token request is not supported for RP.
      */

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


More information about the commits mailing list