[java-oidc-common] branch main updated: Allow acr_values even when using request object

Phil Smart philip.smart at jisc.ac.uk
Thu Dec 22 16:56:38 UTC 2022


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=4dc76f59bf200b8817113c91f581ec67ef9efa68

The following commit(s) were added to refs/heads/main by this push:
     new 4dc76f5  Allow acr_values even when using request object
4dc76f5 is described below

commit 4dc76f59bf200b8817113c91f581ec67ef9efa68
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Thu Dec 22 16:56:35 2022 +0000

    Allow acr_values even when using request object
    
    If the OP does not support the claims parameter, the ACR values will
    have to go in the outer acr_values request parameter
---
 .../profile/encoding/impl/AbstractOIDCMessageEncoder.java    | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/AbstractOIDCMessageEncoder.java b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/AbstractOIDCMessageEncoder.java
index 725e980..a618595 100644
--- a/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/AbstractOIDCMessageEncoder.java
+++ b/oidc-common-profile-impl/src/main/java/net/shibboleth/oidc/profile/encoding/impl/AbstractOIDCMessageEncoder.java
@@ -167,7 +167,17 @@ public abstract class AbstractOIDCMessageEncoder extends AbstractHttpServletResp
             } catch (final IllegalStateException e) {
                 throw new MessageEncodingException("Couldn't serialize request object to JWT: " + e.getMessage(), e);
             }
-        }       
+        }      
+        
+        // Only add ACR values as acr_values if the provider does not support the 'claims' claim. Hence is not contained
+        // inside the request object
+        if (!req.providerSupportsClaimsParameter() && !req.getAcrs().isEmpty()) {  
+            final String acrString =String.join(" ", req.getAcrs()
+                    .stream()
+                    .map(ACR::getValue)
+                    .collect(Collectors.toUnmodifiableList()));
+            params.add(new Pair<>("acr_values", acrString));          
+        }
         
         if (!validateParams(params)) {            
             throw new MessageEncodingException("Authorization parameters are not valid");

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


More information about the commits mailing list