[java-oidc-common] branch dev/JCOMOIDC-41 updated: Fix response_mode setting on message encoder

Phil Smart philip.smart at jisc.ac.uk
Fri Sep 23 16:05:42 UTC 2022


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

philsmart pushed a commit to branch dev/JCOMOIDC-41
in repository java-oidc-common.

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

The following commit(s) were added to refs/heads/dev/JCOMOIDC-41 by this push:
     new 9fbd593  Fix response_mode setting on message encoder
9fbd593 is described below

commit 9fbd593c0ae84f5b915a0f0917dfc704e9762ac6
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Sep 23 17:05:35 2022 +0100

    Fix response_mode setting on message encoder
---
 .../profile/encoder/impl/AbstractOIDCMessageEncoder.java | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoder/impl/AbstractOIDCMessageEncoder.java b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoder/impl/AbstractOIDCMessageEncoder.java
index 6c1fab4..589c259 100644
--- a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoder/impl/AbstractOIDCMessageEncoder.java
+++ b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoder/impl/AbstractOIDCMessageEncoder.java
@@ -125,13 +125,21 @@ public abstract class AbstractOIDCMessageEncoder extends AbstractHttpServletResp
         
         final List<Pair<String, String>> params = new ArrayList<>();
         
-        params.add(new Pair<>("client_id", req.getClientID().getValue()));
-        params.add(new Pair<>("scope", req.getScope().toString()));
-        
+        // The following three parameters are *always* required, even if a request object is used.
+        params.add(new Pair<>("client_id", req.getClientID().getValue()));    
         if (req.getResponseType() != null) {
             params.add(new Pair<>("response_type", req.getResponseType().toString()));
         }
-        if (req.getResponseMode() != null) {
+        // Must contain openid so the authz server knows it is an OIDC request
+        params.add(new Pair<>("scope", req.getScope().toString()));
+        
+        // These parameters are optional if already contained in the Request Object. Although
+        // We add both here (currently).
+       
+        
+        // Only set the response_mode if not equal to the default for that response_type
+        if (req.getDefaultResponseMode() != null && 
+                !req.getDefaultResponseMode().equals(req.getResponseMode())){
             params.add(new Pair<>("response_mode", req.getResponseMode().getValue()));
         }
         if (req.getRedirectURI() != null) {

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


More information about the commits mailing list